About the value of appSettings in the Web.config file

Hi, I'm trying to run a website locally. The website was running on the server, and I got a local copy of everything,including the database. I'm now facing the issue of changing the connection string in the Web.config file.could anyone tell what I shoud put in for the server name? I tried "Local" but didn't get good luck. Any help is highly apprecitated. Thanks in advance!

<configuration>

<system.web>

<compilationdefaultLanguage="c#"/>

<identityimpersonate="true"/>

<authenticationmode="Windows"/>

<pagesvalidateRequest="false"/>

</system.web>

<appSettings>

<addkey="CompanyConnectionString"value="SERVER=DBDEVELOP\QA,7842;Database=friday_dev; uid=user;pwd=12345;"/>

</appSettings>

</configuration>

[3100 byte] By [Sheng1983] at [2007-12-23]
# 1
Maybe I didn't explain it clearly, I just need a correct way to refer the server name as local server. Please give me some suggestions. Thanks!
Sheng1983 at 2007-8-30 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 2
Did I confuse everyone here?
Sheng1983 at 2007-8-30 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 3
I got it solved, thanks
Sheng1983 at 2007-8-30 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 4

As an example this minimal web.config with an appSetting entry to hold our connection string:


<?xml version="1.0" encoding="utf-8" ?>

<configuration>


<system.web>

<compilation defaultLanguage="c#" debug="true" />

</system.web>

<appSettings>

<add key="ConnectionInfo" value="server=(local);database=Northwind;Integrated Security=SSPI" />

</appSettings>

</configuration>

To read the key you use the ConfigurationSettings class from the System.Configuration namespace:


private void Page_Load(object sender, EventArgs e)

{

string connectionInfo = ConfigurationSettings.AppSettings["ConnectionInfo"];
using(SqlConnection connection = new SqlConnection(connectionInfo))

{

connection.Open();


// perform work with connection


}

}

You can refer server address by your computer name also! Got it ?

Peca55 at 2007-8-30 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...