Home All Groups Group Topic Archive Search About

Can connect to SQL 2005 via VPN with .NET 1.1, but cannot with .NET 2.0

Author
13 Dec 2006 8:31 AM
janezcas
Hello,

I have some problems when connecting to the SQL Server 2005 via VPN
connection after the application has migrated from .NET 1.1 to .NET
2.0. The architecture of the application is the following:
..NET 2.0 application (Windows forms) is installed on the client
together with MSDE 2000 and connects ocassionaly with remote SQL 2005
server which is set up as a cluster server, local MSDE is installed as
default instance, when users connect to the remote server they specify
named instance of the remote server. The exchange of data between
client and server is via merge replication.

The local application compiled with .NET 1.1 worked fine, ever since
the application was compiled for .NET 2.0 the connection to the remote
server does not work anymore when users are connecting via VPN (none of
the connections work anymore, even if they do not use merge replication
at all). The connections via LAN work OK.

For that reason, I have compiled two small applications just to test
general connectivity to the server with .NET 1.1 and .NET 2.0.
Basically, what this application does is that it creates instance of
SQLConnection class and tries to connect with named pipes or TCP/IP
protocol to the remote server via LAN or VPN. The results are the
following:

LAN
Application compiled with .NET 1.1 successfully connects to the remote
server via named pipes or TCP/IP.
Application compiled with .NET 2.0 successfully connects to the remote
server via named pipes or TCP/IP.

VPN
Application compiled with .NET 1.1 successfully connects to the remote
server via TCP/IP, but does not connect successfully to the server via
named pipes (SQL Server does not exist or access denied).
Application compiled with .NET 2.0 does not connect successfully to the
remote server via named pipes or TCP/IP. For both the following error
is displayed:
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: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified)).

So the basic difference is that the .NET 1.1 application can connect to
the remote server via TCP/IP when on VPN, but the .NET 2.0 cannot do it
via TCP/IP when on VPN. Both can successfully connect to the server via
TCP/IP when on LAN.

Thanks and best regards
Janez

AddThis Social Bookmark Button