Click here to Skip to main content
15,881,027 members
Articles / .NET

Set the connection string for Entity Framework at runtime

Rate me:
Please Sign up or sign in to vote.
2.00/5 (3 votes)
20 Nov 2011CPOL 16.9K   4  
One possible way is to do it the following way: How to change the connection string in the EntityFramework? [^].

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
2 Aug 2011Bahram Ettehadieh 2 alternatives  
This shows how to set or change the connection string for Entity Framework at run time (programmatically)
Please Sign up or sign in to vote.
18 Nov 2011RedAquarius
The first instruction in .NET 4 becomes:string connectionString = System.Configuration.ConfigurationManager. AppSettings.Get("ConnectionString");

License

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


Written By
Software Developer
Other Other
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions