Home > DeveloperSection > Interviews > Which is the best place to store connectionstring in .NET projects ?

Posted on    January-14-2011 12:00 AM

 ASP.Net ASP.Net 
 1 Answer(s)
  1358  View(s)
Rate this:

Vikas Giri
Vikas Giri

Total Post:33

Posted on    January-14-2011 1:00 AM

web.config is the best place to store the connection string.
for example
<add key="MyConnectionString" value="...connection string value put here..." />

and retrieve it usingConfigurationSettings.AppSettings["MyConnectionString"]

Don't want to miss updates? Please click the below button!

Follow MindStick