Dear friends
I am using CSLA.NET 3.6 version. I have some issue with connection string.
See my connection string is as mentioned below (before running my application),
Connection string file is MyApp.exe.config
<add name="MyApp" connectionString="Data Source=;Initial
Catalog=;User ID=;Password=" providerName="System.Data.SqlClient"
/>
While logging in I change my connection sting as mentioned below,
<add name="MyApp" connectionString="Data Source=MyServer;Initial Catalog=MyDB;User ID=sa;Password=sa" providerName="System.Data.SqlClient" />
I have changed highlighted words in my connection string file while logging in.
The problem is that application will not take the modified connection string while logging in, but when I run my application next time it takes the modified connection string.
Application takes a connection string from MyApp.exe.config file while loading application. This connection string remains same until unless we close the application. That means connection string loads only once at a time while loading an application.
We can change connection string in config file while application running, but It will not effect on application.
I want to change my connection string at runtime and it also should effect on application, please help me out!
Thanks
Raghav
See page 497 of the book to review how the Connection manager works to retrieve connection strings from the app.config file.
You should be able to set up multiple connection strings and then just request any one of them to be used.
Joe
Copyright (c) Marimer LLC