Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii ,

i have one connection string defined in my confi file ..

but based on requirement i am fetching other connection string i am doing following ..

MyDataContext context = new MyDataContext(connectionString);

will it be temporary for perticular scope .. or will it set new connection through out the application ..

hope it will get back to default .. ??

please suggest //
Posted

Each data context use a connection string. The data context invoked without any parameter will use the connection string from your configuration file, but the data context created with a specified connection string will use that connection string without to affect the default one.
 
Share this answer
 
Hello Mr. Torakami
Please See This Solution :
Change LINQ Connection String Dynamically with Programming
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900