Re: Connection Error: ADO.Net and SQL Server 2005



Hi Bill,

Thank you so much for your help. I had read your articles which were
extremely helpful!

It turns out that the problem was that the client had an alias with an
invalid port. He insisted that the port was correct until I asked him to
indulge me and try the default 1433.

The funny thing is that when the port was invalid in the past, the error
I would usually get was something like "server does not exist." So this
error really threw me off.

Once again - thank you for your time.

Maer

"William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxx> wrote in message
news:eZBb2gLwHHA.484@xxxxxxxxxxxxxxxxxxxxxxx
Okay, User ID and Trusted Connection are mutually exclusive. Either your
Windows ID is trusted or it's not. Did you read the whitepaper on
connecting?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Maer" <maer@xxxxxxxxxxxxxxxxx> wrote in message
news:uuvLyFBwHHA.4992@xxxxxxxxxxxxxxxxxxxxxxx
Hi Bill,

Thank you for your reply. I am actually using SqlClient, I only
created an ODBC connection to troubleshoot the problem.

So basically, I can connect to the server through an ODBC connection
(in the Data Sources in Windows), but when I try to use SqlClient to
establish a connection, it fails. The connection string is something like
this:

"data source=servername;persist security info=True;initial
catalog=databasename;user id=username;Trusted_Connection=yes"

Once again, the error is "General Connection Error...[Microsoft][ODBC
SQL Server Driver][DBNETLIB]ConnectionRead (rec())."

It is very puzzling because this client doesn't seem to have anything
different in his configuration.

So far I haven't heard of any problems with .Net 2.0 and SQL Server
2005. Could it be .Net?

Thanks,
Maer



"William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxx> wrote in message
news:eCBwqunvHHA.1212@xxxxxxxxxxxxxxxxxxxxxxx
Well, using ODBC to connect to SQL Server (any version) can and does
work. However, it's certainly not the best way to do so--I recommend
SqlClient. Search my blog for "Connecting" and read the whitepapers
there that discuss the issues.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest
book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Maer" <maer@xxxxxxxxxxxxxxxxx> wrote in message
news:e$qgOMlvHHA.5036@xxxxxxxxxxxxxxxxxxxxxxx
Hi guys,

I have an application that uses ADO.Net (2.0) to connect to SQL
Server. We've never had any problems connecting to SQL Server 2005
using this application, but one client has had problems and the error
he gets is of the type "General Connection Error...[Microsoft][ODBC SQL
Server Driver][DBNETLIB]ConnectionRead (rec())."

I asked him to create an ODBC connection in Windows just to see if
it was only the application, and he has no problem connecting through
ODBC.

So, as you can see, it is very puzzling because when we've had
problems in the past, ODBC would not work either.

Is there some issue with ADO.Net (2.0) and SQL Server 2005? Remember
that other clients are using the software connecting to SQL 2005 with
no problem.

The user says that Firewall is disabled and Remote Connection is
enabled at the server.

Anything else I could check??

Any help will be greatly appreciated.

Thank you,
Maer












.



Relevant Pages

  • RE: Error 17835 - When encryption and Shared Memory are enabled
    ... Did you encounter this error when you connected to your SQL Server ... Did your SQL Server instance use a certificate explicitly specified by ... you configure your client connection settings "Force Protocol Encryption" ...
    (microsoft.public.sqlserver.connect)
  • Re: ODBC to SQL Server Express?
    ... >Server connection, in both the system's ODBC connection manager and the ... >>>Can I create an ODBC connection to SQL Server Express? ... >>>Server Express and Visual Web Developer Express (for a database frontend ... I need to access the SQL Server Express databases via ODBC. ...
    (microsoft.public.data.odbc)
  • Re: Losing connections with SQL 2005
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... SQL Server automatically detects if the client falls into the sea or gets ... Does the Connection pooling mechanism do this on its ... Upgrading our app is a really big task, ...
    (microsoft.public.sqlserver.connect)
  • Re: netbios and named pipes sql replication.
    ... Once the client switched to named pipes, ... > connection with. ... > When we took named pipes support off the SQL server with the MS patch, ... > We had to manually walk thru the ODBC setup and configure the CLIENT ...
    (microsoft.public.sqlserver.replication)
  • Re: Problem connection to SQL Server with ODBC
    ... What protocols are being used by the client and what is the ... Are you using an alias for the connection? ... SQL Server Clients May Change Protocols When They Try ...
    (microsoft.public.sqlserver.connect)