connecting vs 2005 to remote SQL server 2000

M

Me LK

I did a search but could not find an aswer that worked so here it
goes.

I just did an upgrade from 2003 to vs 2005 express. I am using a
remote sql server 2000. I specifically upgrade to make use of the
login control. Everything upgraded fine and the site is working on my
local machine.

It seems that my site is trying to connect to a local database. I need
it to attach to a remote database. I added a connection string to
webconfig as follows

<connectionStrings>

<add name="myconnection"
connectionString="server=sqldatabaselocation.com;uid=###;pwd=###;database=name"
providerName="System.Data.SqlClient"/>
</connectionStrings>

but no change. I then tried to clear the database as I had seen in
other posts. Then I got a machine.config error

<connectionStrings>
<clear />
<add name="myconnection"
connectionString="server=sqldatabaselocation.com;uid=###;pwd=###;database=name"
providerName="System.Data.SqlClient"/>
</connectionStrings>

So how does one connect to a remote sql server 2000 so that it is
recognized in the website admin tool?
 
D

Dave Bush

Your problem is that the connection string it is looking for is the
LocalSqlServer connection string (that's what gets used for membership
and personalization.) Just create a duplicate connection string like
the myconnection connection string that has a name of LocalSqlServer and
you should be ok.

I wrote this up a long time ago, sorry you couldn't find it.
http://www.dmbcllc.com/Articles/WebDevelopment/MembershipDatabase/tabid/
165/Default.aspx

-----Original Message-----
From: Me LK [mailto:[email protected]]
Posted At: Tuesday, October 30, 2007 2:08 PM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: connecting vs 2005 to remote SQL server 2000
Subject: connecting vs 2005 to remote SQL server 2000

I did a search but could not find an aswer that worked so here it
goes.

I just did an upgrade from 2003 to vs 2005 express. I am using a
remote sql server 2000. I specifically upgrade to make use of the
login control. Everything upgraded fine and the site is working on my
local machine.

It seems that my site is trying to connect to a local database. I need
it to attach to a remote database. I added a connection string to
webconfig as follows

<connectionStrings>

<add name="myconnection"
connectionString="server=sqldatabaselocation.com;uid=###;pwd=###;databas
e=name"
providerName="System.Data.SqlClient"/>
</connectionStrings>

but no change. I then tried to clear the database as I had seen in
other posts. Then I got a machine.config error

<connectionStrings>
<clear />
<add name="myconnection"
connectionString="server=sqldatabaselocation.com;uid=###;pwd=###;databas
e=name"
providerName="System.Data.SqlClient"/>
</connectionStrings>

So how does one connect to a remote sql server 2000 so that it is
recognized in the website admin tool?
 
G

Guest

The first thing you must do is provide a <remove name="LocalSqlServer" />
element because that is pre-defined in the master web.config. This then
leaves you clear to provide your own.

the connection string should look like:

<add name="myconnection"
connectionString="server=machinename;database=databasename;uid=username;pwd=password" providerName="System.Data.SqlClient"/>

-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top