Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

ASP.NET 2.0/SQL Server 2000 Connection Problem.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vikram S - 19 Jun 2007 16:35 GMT
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
George Ter-Saakov - 19 Jun 2007 18:46 GMT
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.

> Hi All,
>
[quoted text clipped - 29 lines]
> Thanks,
> Vikram

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.