473,385 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problem Connecting .NET app to SQL Server

Hi,

I am having a problem connecting my .net applications from the
application server to the database server. When I run the application
from my windows xp (sp2) box it works fine. When I try to connect via
SQL Management Studio to the database server from the application
server I get the same error.

Here is the error:

System.Data.SqlClient.SqlException: 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)

Here is the Environment:

App Server:

Windows Server 2003 Standard Edition

Inside Company's Firewall/ Network
Database Server:

Windows Server 2000 Advanced Edition

SQL Server 2000 SP4

Remote Connections to the Server is checked

Enable Protocols: Named Pipes & TCP/IP

TCP/IP Port: 1402 (I don't know why it isn't the default of 1433)

The db server is sitting out side the Company's firewall (don't ask me
why). I can access it fine from inside the firewall on my XP box but
not from windows server 2003. There is a web server outside the our
network that also connects to the db server with no problem and that
is running Windows Server 2003 Web Edition.

I can ping the db server from the app server using the IP address.

I tried using the IP address and the port 1402 in my connection string
but that didn't work from any machine (XP and Server).

I imagine the issue is somehow related to the company's firewall but
why would it only block Windows Server 2003 and not XP?

What do I tell the network admin to change?

Any help would be appreciated.

Thanks,

Oran
Apr 3 '08 #1
2 2996
orandov (or*****@gmail.com) writes:
I imagine the issue is somehow related to the company's firewall but
why would it only block Windows Server 2003 and not XP?
Some firewall could be set up to accept the IP address of your XP
box, but not the application server. Apparently, you are able to ping
the db server from the app server, but the firewall on the db server
may not be open to everyone on port 1433. (You said it was on port 1402,
but maybe you looked in the wrong place? The best place to look is
the SQL Server errorlog.) Also check UDP 1434.

Also, when you tried using port 1402 in the connection string, how
did you actually do it?

Not a very conclusive response, but issues like these are difficult to
diagnose on a distance.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Apr 3 '08 #2
I let the visual studio dialog build the connection string for me with
the IP Address and now it is working with port 1402.

What I am still puzzled by is that SQL Server Management Studio &
Enterprise Manager (on a Windows Server 2003) can't connect to the
Server with only the server name and it requires the IP Address but on
my XP workstation it works fine with only the server name.

My network admin says there is no difference in the way the Windows
Servers are set up on the network than the XP workstations.

Thank for your help.

Oran
Apr 4 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ali | last post by:
I'm trying to write a really basic chat program that allows 2 client programs to send messages to each other via a server. I've managed to write the code so that both clients can connect to the...
1
by: Dmitry Akselrod | last post by:
Hello everyone, I have a vb.net application that wraps the TCPListener object in a class. The server connects to the local interface and establishes itself on port 9900. It then polls for...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
0
by: richard | last post by:
OS: Winxp and Win2003 Visual Basic.NET 2003 MS-SQL Server 2000 hey all I am a newbie in vb.net but i have managed to build a simple chat server in vb.net using socket and a client connecting...
2
by: John | last post by:
Hi I was working fine with create user wizard and the default membership provider. I have now customised the membership provider as per attached web.config. The create user wizard picks up the...
9
by: RvGrah | last post by:
After much hair-pulling, I've finally found the answer to a problem that many are fighting with, difficulty connecting from Sql 2005 Server Management or VS2005 to a remote Sql Server running Sql...
0
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
0
by: NoaGross | last post by:
Hi, I'm relly new in java and I have a problem. I'm using java applet. When using http all ok, but when trying to use https i get: Java Plug-in 1.5.0_10 Using JRE version 1.5.0_10 Java...
9
by: darthghandi | last post by:
I am trying to create a server application using asynchronous sockets. I run into a problem when I try to connect to my server using a non-.net program. I can establish the connection, and send...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.