WHICH IS THE BEST PLACE TO STORE CONNECTIONSTRING IN .NET PROJECTS ?

Vikas Giri

Total Post:33

Points:165
Posted by  Vikas Giri
 1617  View(s)
Ratings:
Rate this:
  1. Vikas Giri

    Post:33

    Points:165
    Which is the best place to store connectionstring in .NET projects ?

    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"]

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!