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
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@.auditleverage.com> wrote in message
news:e$qgOMlvHHA.5036@.TK2MSFTNGP03.phx.gbl...
> 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
>
>
|||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@.betav.com> wrote in message
news:eCBwqunvHHA.1212@.TK2MSFTNGP05.phx.gbl...
> 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@.auditleverage.com> wrote in message
> news:e$qgOMlvHHA.5036@.TK2MSFTNGP03.phx.gbl...
>
|||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@.auditleverage.com> wrote in message
news:uuvLyFBwHHA.4992@.TK2MSFTNGP04.phx.gbl...
> 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@.betav.com> wrote in message
> news:eCBwqunvHHA.1212@.TK2MSFTNGP05.phx.gbl...
>
|||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@.betav.com> wrote in message
news:eZBb2gLwHHA.484@.TK2MSFTNGP06.phx.gbl...
> 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@.auditleverage.com> wrote in message
> news:uuvLyFBwHHA.4992@.TK2MSFTNGP04.phx.gbl...
>