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 all #6


hi there!
I've uploaded my website at online server. which has its database on its local server. Now whenever Im trying to open the website. I get the following message instead of website.
"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) "
Im using sql server 2000 for database. Asp.net 2.0
Please help me out.
waiting for your positive response.
thanks
Nouman Rasheed
 

If the going seems easy, You are going DownHill...
0
khnouman
8/12/2008 8:45:10 AM
📁 asp.net.sql-datasource
📃 29906 articles.
⭐ 0 followers.

💬 14 Replies
👁️‍🗨️ 2171 Views



 Try this type of code that will help u to solve this problem
 System.Data.SqlClient.SqlConnection myConn = new System.Data.SqlClient.SqlConnection(confirgurationmanager.appsetting["con"].tostring());SqlCommand myComm = new SqlCommand("SELECT LoginID, Password FROM LOGIN", myConn);
myConn.Open();
in web.config file
<appsetting> 
<add key="con" value="Initial Catalog=MIS;Data Source=localhost;Integrated Security=true; Username="sa" password="xxxxxxxxxxxxx"/>
</appsetting>
click on start->all program->mssqlserver->configurationsettingtools->surfaceareanetwork->surfacearea configuration for service and connection-> services  check weather it allow as piped name with TCP/IP is checked if not plz check that and click on ok
I think ur using Windows auth for login in SQL SERVER am i right

Can u tell are u using Windows auth or Sql auth  
If u have problem plz revert me back
MARK AS ANSWER

Thanks & Regards
Ramkumar.V
www.tnbytes.com
info@tnbytes.com

Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
-2
Ramkumar
8/12/2008 8:50:57 AM

Im using the following code
<add name="conString" connectionString="Server=localhost;Database=db;Integrated Security=true;User ID=ID;Password=password;Trusted_Connection=False;" providerName="System.Data.SqlClient" />
and im using sql authentication.
still getting the same error :(

If the going seems easy, You are going DownHill...
0
khnouman
8/12/2008 9:00:50 AM

 Hi,
Try removing the Integrated security=true in the connection string

Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue
:) Sibi :)
-1
Sibin
8/12/2008 9:03:19 AM

Hi, 
click on start->all program->mssqlserver->ConfigurationSettingTools->SurfaceAreaNetwork->SurfaceAreaConfiguration for service and connection-> Remote Connection check weather it allow both TCP/IP and piped name wis checked if not plz check that and click on ok
Follow this process if u have problem
 

Thanks & Regards
Ramkumar.V
www.tnbytes.com
info@tnbytes.com

Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
0
Ramkumar
8/12/2008 9:39:05 AM

I've removed but still not working
It was working fine since last one month. But today suddenly it prompts this error.
And yeah now when i m trying to access its database on its online server this prompts another error :(
its  database is not opening there at server :)

If the going seems easy, You are going DownHill...
0
khnouman
8/12/2008 10:46:06 AM

Im facing this problem at online server not at local. M hell frustrated ::(
 

If the going seems easy, You are going DownHill...
0
khnouman
8/12/2008 10:48:02 AM

 Hi,
One more try, specify the port number also in the connection string
i.e server="localhost;123"  and specify
this also in connection string
Network Library=DBMSSOCN;
 
refer the link for connectionstrings
http://www.connectionstrings.com/?carrier=sqlserver2005

Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue
:) Sibi :)
0
Sibin
8/12/2008 11:12:16 AM

Is ur online server is Godaddy Server if yes ping me to

Thanks & Regards
Ramkumar.V
www.tnbytes.com
info@tnbytes.com

Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
0
Ramkumar
8/12/2008 11:22:29 AM

hey
man I dont know any thing about server. I've mailed the concerning person. As i get the information i'll let you know.
I've tried every trick but doesn't work. Please help me out.
Thanks
 

If the going seems easy, You are going DownHill...
0
khnouman
8/12/2008 2:18:36 PM

 Hi,
Did you tried....
specify the port number also in the connection string
i.e server="localhost;123"  and specify
this also in connection string
Network Library=DBMSSOCN;
 
refer the link for connectionstrings http://www.connectionstrings.com/?carrier=sqlserver2005
 

Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue
:) Sibi :)
0
Sibin
8/12/2008 2:20:16 PM

As I've mentioned that i dunno both hosting server and port number both. And i'll soon get them.
And yeah to remind you, im repeating that i m using sql server 2000 not 2005.
Thanks
 

If the going seems easy, You are going DownHill...
0
khnouman
8/12/2008 2:35:43 PM

For reference to my website you may visit to
http://www.tsctevt.edu.pk
please suggest me any solution.
Thanks
 

If the going seems easy, You are going DownHill...
0
khnouman
8/12/2008 3:26:02 PM

 Get all the information
  1. Hosting with?
  2. Server is with?
as soon as possible to that i can help u more Dude

Thanks & Regards
Ramkumar.V
www.tnbytes.com
info@tnbytes.com

Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
0
Ramkumar
8/12/2008 4:44:51 PM

Thanks for showing your deep concern man.
I've sent an email to related person. As he is sends it to me,I will paste it here.
Thanks
 

If the going seems easy, You are going DownHill...
0
khnouman
8/12/2008 4:54:15 PM
Reply:

Similar Artilces: