SelfServicing: ConStrings --> Set Globally at Run Time?

Posts   
 
    
ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 27-Dec-2006 02:01:14   

Is it possible to set the **ConnectionString **that all calls to a **SelfServicing **object will use only once at run time?

We do not know the connection string until after the application loads. It is different for each user of the application so can't/shouldn't be stored in the App.Config

Ian

JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 27-Dec-2006 04:07:13   

It can be set as a static setting at runtime using whatever startup procedure you like.

From the manual:

Connection strings The DbUtils class lets you set the global connection string to use for every connection to the database. This setting overrides the connection string read from the appSettings section in the .config file. Once the setting is set, every connection to the database uses the set connection string. You set the connection string to use at runtime using the following code: // C# DbUtils.ActualConnectionString = "Datasource=myserver;...."; ' VB.NET DbUtils.ActualConnectionString = "Datasource=myserver;...."