problem connecting to remote server with SqlDataSource

G

Guest

I'm trying to use SqlDataSource to connect to a remote SQL Server 2005
(virtual shared hosting e.g. TCP/IP). I keep getting the following error:
provider: Named Pipes Provider, error: 40 - Could not open a connection

I don't know why my sql client is using named pipes, it should be using
TCP/IP?

Here is my connection string:
"Data source=mysqlserver;initial catalog=mydatabase;user
id=myuserid;password=mypassword"

Any help would be greatly appreciated.
 
J

Juan T. Llibre

To connect via an IP address to a SQL Server 2005:

"Data Source=111.111.111.111,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"

Of course, substitute the real IP address for 111.111.111.111

Remember that DBMSSOCN=TCP/IP instead of Named Pipes,
and that the port to use (1433 is the default) goes at the end of the Data Source.

If the SQL Server 2005 is using a different port, make sure and use that one.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
G

Guest

Thank you, thank you, thank you!

I've been tearing my hair out over this for two hours and am on a deadline
as per usual!!
 

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

Top