Adding Connectionstring in web.config file

Hello, I want to add a certain line in the web.config file which would be the connectionstring.  I want to add the following line:

<add key="ConnectionString" value="server=test,4155;database=testdb;uid=admin;pwd=Password"/>

Where exactly would I add this <add key> line in my web.config file?
VBBRettAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
vinodchConnect With a Mentor Commented:
you have to add the key in appsettings, however you can use the connectionstring key

      <appSettings>
     <add key="ConnectionString" value="server=test,4155;database=testdb;uid=admin;pwd=Password"/>
 </appSettings>
 <connectionStrings>
            <add name="ConnectionString" connectionString="server=test,4155;database=testdb;uid=admin;pwd=Password"/>
      </connectionStrings>
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
<configuration>
  <appSettings>
   ... here
  </appSettings>

</configuration>
0
 
Carl TawnSystems and Integration DeveloperCommented:
Generally for connection strings you would add them to the <connectionStrings /> section rather than <appSettings />
0
All Courses

From novice to tech pro — start learning today.