Solved

Adding Connectionstring in web.config file

Posted on 2010-11-08
3
377 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:VBBRett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34084921
<configuration>
  <appSettings>
   ... here
  </appSettings>

</configuration>
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34085147
Generally for connection strings you would add them to the <connectionStrings /> section rather than <appSettings />
0
 
LVL 4

Accepted Solution

by:
vinodch earned 500 total points
ID: 34085171
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question