Solved

Adding Connectionstring in web.config file

Posted on 2010-11-08
3
376 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
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Suggested Solutions

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…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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