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
Note that, depending on your application architecture, changing the connection may have other ramifications.
In particular, if you have statically loaded, cached, or lazily loaded data that is specific to the connection (e.g. NameValueLists for example) and these aren't the same from one database to another, you may to implement some pretty exciting plumbing to ensure they are reset.
In our case, the per-class business rules even change from one database to another, so we are basically forced to exit and respawn the application if you change the connection.
Copyright (c) Marimer LLC