Thanks for all your suggestions. Unfortunately, none of them worked :o(

Yes, HOTH is a bit cold for Yoda :o)

I've tried a variety of things in the connection string. I've eliminated
spaces and trailing semi-colons.

Incidentally, other tools such as query analyser connect successfully.

I've set up an alias. I've double checked that TCP/IP is set in the client
network utility.

One other thing I forgot to mention was that the two W2K SP3 boxes in
question are not part of a domain, only a work group. Could this be the
culprit?

Martin

-----Original Message-----
From: Beauchemin, Bob [mailto:[EMAIL PROTECTED]]
Sent: 18 December 2002 17:08
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] SqlConnection and named SQL Server 2000
instance


Named instances work OK here.

A way around using named instances at all (something to try if you are
having trouble with them or using an old API that can't deal with them) is
to add an alias in SQL Server Client configuration utility. Alias a TCP/IP
connection to data source=hoth\\projectx to myserver or some other name.
Also, use client config utility to make sure your client is using TCP/IP (it
should be by default), you can get "connection refused" if you don't have
permission to open a named pipe connection on the SQL Server machine.
"Connection refused" is a totally different error than "server not found".

You can also create a file that has a .UDL suffix and use it to tweak your
connection parameters until "Test Connection" works. Then open the UDL in
Notepad and extract the connection string.

Someone else already suggested losing the trailing comma.

Bob Beauchemin
http://staff.develop.com/bobb

-----Original Message-----
From: Martin Welch [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 1:18 AM
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] SqlConnection and named SQL Server 2000
instance


Has anyone successfully connected to a named database instance with
SQLConnection?

I assumed something like this would work but all I get is server not found
or refused connection errors:

SqlConnection conn = new SqlConnection("user id=jedi;password=yoda;initial
catalog=pubs; data source=hoth\\projectx;");
conn.Open();

I've trawled though google, on line help and msdn but so far I've come up
with nothing.

Can anyone enlighten me?

Martin

You can read messages from the Advanced DOTNET archive, unsubscribe from
Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the Advanced DOTNET archive, unsubscribe from
Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to