I have an app that I've written in .NET 2.0 using SQL 2000 as the back end. It works fine in development but when I move it out to our QA server I get the following error.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
One of the odd things I notice is that the error message references SQL Server 2005 when that's not installed on our QA box, only SQL 2000 is on it.
I've checked the server and TCP/IP and Named Pipes are enabled.
Here is my connection string
<add name="myConnectionString" connectionString="Data Source=(local);Integrated Security=false;Initial Catalog=TestDatabase;User Id=myUsername;Password=myPassword;" providerName="System.Data.SqlClient"/>
There's at least one other .NET 2.0 application running on this server that accesses the database so I know that it can work! However, have access to the source code for that application so it's not any help with my troubleshooting.
Any thoughts or ideas?
Is the SqlServer 2000 service running on the same machine? You connection configuration is pointed to a (local) copy of SqlServer. Also, make sure that the myUsername exists on the QA server.
|||Yes. Sql 2000 is on the same box.
And I double checked that myUsername exists in that QA SQL server and has rights to my database.
Thanks though.
I'll post back when I figure it out.
If anyone else wants to weigh in I'm all ears.
Hi,
I had the same problem.
Check this Registry entry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo.
Are there any entries that reference the SQL server you want to use (DBMPNTW = named pipes)? If so remove them.
Regards,
Thierry
No comments:
Post a Comment