Unable to connect to SQL Server database

I am currently developing a web application using asp.net C #. I have a server on which I am going to publish my site and its database today. This is a server running Windows Server 2008 R2.

But I have one problem:

My website does not seem to be accessing the database. If I started the site from another computer on my local network, I can access the server database, BUT I can not when I launch the website from the same server on which the database is located. This is really weird. I hope someone can help.

I am just getting an error that cannot access the database.

The strangest thing is that I use the same connection string on both computers, but it still does not work. Are there any settings in Windows Server 2008?

Here is my connection string:

<add name="ConnectionString" 
     connectionString="Data Source=AXELS;Initial Catalog=Sailor;Persist Security Info=True;User ID=sa;Password=saab123" 
     providerName="System.Data.SqlClient" />
+5
source share
4 answers

Since the connection works on one computer and not on another, I would suggest that you have a problem with a firewall or similar - but it will be difficult to say until we see the actual error message. Until then, there are a few things you might want to do:

  • , , . ? , ( ) , , - ? , 1433 .

  • -, ?

  • , ODBC - → (ODBC). , , , .

, :

http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/

, - , -, , SQL Network Interfaces, error: 26

http://blogs.msdn.com/b/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx

+2

, , .
, , .

, Windows, , , , .

+1

, , , SQL Server, .

C:\Windows\System32\cliconfg.exe - 64-

C:\Windows\SysWOW64\cliconfg.exe - 32-

SQL Server Configuration Manager " SQL Server".

0

, Windows, priviliges Christian Specht - .

, , , , , , .

There seems to be a problem with the way the server resolves localhost, as it will try to resolve the data source on localhost, since AXELS = localhost on this machine.

Take a look at the hosts file and see if there are any funny pointers besides the default value.

Located in the folder C: \ Windows \ System32 \ drivers \ etc

Must be entry: 127.0.0.1 localhost

0
source

All Articles