Re: Irritating SQL 2000/2005 connection problem




Well, we found the solution to this problem. I'm posting the answer in case
others have a similar problem.

In the project file under "Debug" (C#) is an option: "enable the Visual
Studio hosting process". We have to uncheck that. For some reason, the
hosting process that it produces in DEBUG builds causes problems with
ADO.NET/Sql provider and the way to resolve it is to disable the hosting
process. This is not enabled by default for RELEASE mode and explains why
the application works fine in RELEASE mode. We discovered this problem
after working with Microsoft support for a week or so. Actually, they know
about it and I don't know whether there will be a fix in the upcoming SP.


Thanks,
Shawn



Our network environment uses only SQL 2000. We do not have SQL 2005
installed on our network anywhere. Using ADO.NET (SqlCommand and
SqlConnection) to connect to a SQL 2000 database with a connection string
that has worked for 4 years until we migrated to .NET 2.0 we get this
error:

-----
A connection was successfully established with the server, but then an
error occurred during the pre-login handshake. 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 - A request to send or receive data was disallowed
because the socket is not connected and (when sending on a datagram socket
using a sendto call) no address was supplied.)
------


A couple things to note: we have no clue where its getting SQL 2005 from.
We do not have SQL Express or 2005 installed. Second, we have many
servers on our network (some for various releases in Dev, Staging, QA, and
production). In trying to connect to any server this problem manifests.
In all cases, SQL is version 2000 with latest SP applied (as well as the
Win2k3 and Win2k servers).

More perplexing, when this problem manifests in a WinForms application, it
will only manifest in DEBUG mode but not RELEASE mode. There is nothing
in our code that treats DEBUG and RELEASE differently. Nothing in the
project settings that are out of the ordinary (or that were modified by a
human since the project/solution was created).

When this problem manifests in a WebForms application, it happens in
RELEASE mode. We've been trying to troubleshoot this for 2 weeks now and
even have a support ticket with MS but we're getting no where.

I'm hoping that someone will have some ideas, some things to try to narrow
it down. Microsft doesn't think its a compiler error. I don't know
whether it is or not. The error happens during the SqlConnection.Open()
command instantly.

We have already heavily investigated any potential network issues, network
configurations, network settings, switch/router/firewall
configuration/failures, etc.

We never had this problem with Framework 1.x but only since we've migrated
to 2.0 and its too late to turn back now.

I don't know what I'm asking for, just ideas and suggestions, something to
try.


Thanks,
Shawnh



.



Relevant Pages

  • Re: Outgoing POP3 email missing/lost/not received
    ... Funny thing is that I have had this ISP for 8 years and it has always been ... It looks like when you last ran CEICW, you set the ISP's mail server to: ... Internet Connection Wizard. ... After the wizard completes, the following network connection ...
    (microsoft.public.windows.server.sbs)
  • Re: Connection from remote computer to network SQL Server
    ... by default connectin to SQL Express from the network is disabled ... There is no firewall on the W2K machine acting as the SQL server. ... connection works. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Outgoing POP3 email missing/lost/not received
    ... ISP's mail server instead of the domain name on the ... SUMMARY OF SETTINGS FOR CONFIGURE E-MAIL AND INTERNET ... Internet Connection Wizard. ... After the wizard completes, the following network connection ...
    (microsoft.public.windows.server.sbs)
  • RE: Problems with Permissions
    ... And SBS server is only take ... the role of an internal server. ... they are all configured to connected to internal network. ... g. Run the Configure Email and Internet Connection Wizard on SBS server. ...
    (microsoft.public.windows.server.sbs)
  • Re: Connection from remote computer to network SQL Server
    ... There is no firewall on the W2K machine acting as the SQL server. ... I tried making the SQL machine a "trusted" on the router. ... connection works. ... To find the IP address of your computer inside the network, ...
    (microsoft.public.access.adp.sqlserver)