March 15, 2006 at 4:32 pm
I am starting to develop using vs 2005 and .net 2.0 and am running into trouble connecting to my db.
i am use to .net 1.1 and have a db class i use for connecting and doing other db related actions. it works fine in 1.1 but in 2.0 i get the following error when attempting to connect to the db.
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)
the odd thing is i am using sql 2000 so i am not sure why it is even saying 2005.
any help would be appreciated.
March 16, 2006 at 2:57 pm
Hi,
You may want to re-check your connection string if it explicitly specifies a server name, intance name, database name, user name etc. It may happen that your code is trying to connect to 2005 instance installed at the same time as your VS2005 if the installation was done by someone other than you.
Also this error message may try to explain to you what does it mean in case of 2005 server (as I understand this message) and does not tell you what does it mean in case of 2000 server. probably it would be the same explanation.
Regards,Yelena Varsha
March 16, 2006 at 4:57 pm
the code i am using to connect to the database is the identical class that i have used for countless projects in .net 1.1 and vs 2003 so i don't think the connection string is bad.
i did install sql server 2005 express locally when i installed vs 2005 and the 2000 database which i am trying to connect to is located on a remote machine. i have uninstalled all aspects (as far as i could tell) of sql 2005 from local machine in hopes that it would fix any confusion as to what db the program should be connecting to but that also has not fixed or altered the issue in any way.
any other suggestions?
April 26, 2006 at 9:07 pm
I'm having the same problem. Exact same circumstances except mine will only come up with that error sporadically.
April 27, 2006 at 9:05 am
In Enterprise Manager right click at the top and go to Server properties, then Network configurations and make sure you have enabled both Named Pipes and TCP/IP. Then go back to VS 2005 and at the top you will see the Data Link property click on it and choose your database to connect. You are getting the error because VS 2005 assumes you are using SQL Server 2005. Hope this helps.
Kind regards,
Gift Peddie
Kind regards,
Gift Peddie
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply