Solved

Adding Connectionstring in web.config file

Posted on 2010-11-08
3
367 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 142

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now