Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 how to change default connection string datasource

Author  Topic 

salmonraju
Yak Posting Veteran

54 Posts

Posted - 2007-08-28 : 05:39:43
Hi,
I am Creating ASP.Net application,in my website I am using Login Controls
My Machine.Config contains following for connection string
add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"
/connectionStrings

DataSource=.\SQLEXPRESS, But my system doesnot Have SQLExpress

I want to modify this, I changed my Web.Config as

add name="LocalSqlServer" connectionString="data source=.;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"

When I am executing the web site I am getting the following errors
The entry 'LocalSqlServer' has already been added

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-08-28 : 10:50:38
you cannot have two entries with the same name. Remove the old one or rename it to "localsqlserver_old" or something like that.



- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -