User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 423,380 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,816 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 1636 | Replies: 2
Reply
Join Date: Jun 2007
Posts: 5
Reputation: Bugaya is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Bugaya Bugaya is offline Offline
Newbie Poster

sql server2005 System.Data.SqlClient.SqlException: An error has occurred while establ

  #1  
Sep 20th, 2007
I'm using VS2005 & SQL Server 2005 which is installed with VS2005.
Platform is XP SP2.
I've an app that connects to the DB & get some data from it .
The app & DB are on the same machine .

Suddenly When I run the app. , I've that 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)

I've searched over the net for that problem & I've done what others did:
1- Enable Remote Connection:Using both TCP/IP & named pipes.
2- Maker sure that the service is running .
3- Add exceptions to the firewall
Then after that ,I'm still facing the same problem .
After all trials ,I've uninstalled VS2005 & all it's component .
After installing it again ,I've the same problem .

So the Solution is ....?!!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 5
Reputation: adamm84 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
adamm84 adamm84 is offline Offline
Newbie Poster

Re: sql server2005 System.Data.SqlClient.SqlException: An error has occurred while establ

  #2  
Sep 25th, 2007
if your sql server is running on the same box, it won't be a firewall issue, it sounds like you need to check your database permissions. check what account you have visual studio running under and enable this as a user for your database.
Reply With Quote  
Join Date: Jun 2007
Posts: 5
Reputation: Bugaya is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Bugaya Bugaya is offline Offline
Newbie Poster

Re: sql server2005 System.Data.SqlClient.SqlException: An error has occurred while establ

  #3  
Sep 26th, 2007
First ,Thanks adamm4.
Second ,I'd discouvered that the problem in the connection string . specifically in the Data Source ,althouhg , I copied it from the Conn Str prob. & it was working before.
All what I've done to make it work again is to but \\ rather than \ in the Data Source .
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 12:40 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC