connection info in the configuration file


where to store the connection info in the configuration file of a project and how to read it ?
Who is Participating?
DhaestConnect With a Mentor Commented:
In your app.config
      <add key="connectionString" value="server=servername;database=dbname;integrated security=sspi" />

To reference that in your code:

Dim oConn As New SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
Read connection string from web.config

Custom Configuration SQL Connection String Section
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.