Bashar wrote:
Hi Guys,
- LLBLGen Pro version + buildnr: Version 2.0.0.0 November 6th 2006
How can I dynamically create a ConnectionString in a SelfServicing project?
Thanks,
Bashar
From the docs section "Generated code - DbUtils functionality":
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;...."
If you want to make the application use the connection string defined in the config file again, simply set the ActualConnectionString property to string.Empty.