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 
Ratings:
 1 Answer(s)
  1367  View(s)
Rate this:

Vikas Giri
Vikas Giri

Total Post:33

Points:165
Posted on    January-14-2011 1:00 AM

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

and retrieve it usingConfigurationSettings.AppSettings["MyConnectionString"]


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

Follow MindStick