ASP.NET 2.0/SQL Server 2000 Connection Problem.

V

Vikram S

Hi All,


I have an ASP.NET 2.0 web application on a web server and a separate machine
for SQL Server 2000 Database. I am using a Connectionstring based on Sql
Authentication to connect to the the SQL 2000 Database.

Now, When I open the web page on the Web Server itself, I am able to
successfully connect to the Database which confirms that the connection
string is correct. However when I open the same web page from another client
machine other than the web server, I get the following error message:

"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) - .Net SqlClient Data Provider"

if I try to force TCP/IP specifying "Network Library=DBMSSOCN;" then it does
not work at all from any machine and 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: TCP Provider, error: 0 - No connection could be made because the
target machine actively refused it.) - Net SqlClient Data Provider"

SQL Server is on default port 1433 and both TCP/IP and Named Pipes protocols
are enabled.


Any advice on this is much appreciated.

Thanks,
Vikram
 
G

George Ter-Saakov

Rule #1. Always use TCP/IP to connect to SQL from ASP.NET
So keep Network Library=DBMSSOCN and make it work with it.
----------------------------------------

You need to enable TCP/IP on MS SQL side.
Right click on SQL server in SQL Server enterprise manager. Tab "General".
Button "Network Configuration"
Make sure you have TCP/IP in enabled protocols.

Also make sure that if there is any firewall between Web server and SQL then
it's open. Also try to ping the SQL server from Web server. Sometimes web
server can not resolve the name of the SQL server due to the network
configuration. Fix it or use IP address.

George.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top