January 9th, 2003, 08:30 AM
System.Data.SqlClient.SqlException: General network error
When filling a dataset I am getting this error.
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
System.Data.SqlClient.SqlException: General network error. Check your network documentation.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, TdsParserState state)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, TdsParserState state)
at System.Data.SqlClient.TdsParser.ReadNetlib(Int32 bytesExpected)
at System.Data.SqlClient.TdsParser.ReadByteArray(Byte buff, Int32 offset, Int32 len)
at System.Data.SqlClient.TdsParser.ReadString(Int32 length)
at System.Data.SqlClient.TdsParser.ReadValue(_SqlMetaData md, Int32 length)
at System.Data.SqlClient.SqlDataReader.SeqRead(Int32 i, Boolean useSQLTypes, Boolean byteAccess, Boolean& isNull)
at System.Data.SqlClient.SqlDataReader.SeqRead(Int32 i, Boolean useSQLTypes, Boolean byteAccess)
at System.Data.SqlClient.SqlDataReader.GetValues(Object values)
at System.Data.Common.SchemaMapping.LoadDataRow(Boolean clearDataValues, Boolean acceptChanges)
at System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping mapping)
at System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDataReader dataReader)
at System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at ProjectOpening.frmProjectInfo..ctor() in c:\temp\myProject\frmProjectInfo.vb:line 39
January 10th, 2003, 10:17 AM
Well it would seem if I query one record at a time it works just fine but if I query all the records in the table I get the above error. I guess now I am wondering if I have some corrupt records and will this come back to haunt me later when a user queries that record.
January 22nd, 2003, 10:13 AM
I am having the same problem. We think we've narrowed it down to data size, and here is why:
We have a query that returns about 3,000 records. If we run our process that executes this query, we get the General Network Error. If we return TOP 701 * it works. If we return TOP 702 * it fails with the same error. At that point, you would have to figure it was data related on that 702 record, but it's not. We limited the number of fields and were able to increase the number of rows returned. No matter what we changed, there seems to be a data size threshhold on that query.
We've tried filling a DataSet and executing and SqlDataReader and get the same results.
What makes it even stranger, is that this only happens when running on one particualar box. Database server is a SqlServer 2000 box and the web server is a Windows 2000 box. When running the process on another machine, it works fine.
This problem has stumped our entire IT department. It was suggested that we update the MDAC, which we did, and we still have the same error.
Anyone have ANY insight to this?
January 22nd, 2003, 12:38 PM
Almost a week later, just when you've given up hope...
Well, this problem has been solved. After being bounced back in forth between DBA's, developers, Network Admins and some of our local astrologist, we think we found a bug in ADO.NET (maybe).
The query we were using had several conditions in the WHERE clause. We got it down to where we could comment out 1 clause and the query would work fine. Add it back in, General Network Error.
After a few hours a screwing with the query, one of the DBA's (whom we shall now refer to as 'The Hero'), decided to add an ORDER BY clause so we could do some debugging.
Sure enough, the processes executed and completed.
Our initial conlusion is that the order in which the OR clauses where written and the absences of an ORDER BY, ADO.NET chocked on the execution plan. The query without the ORDER BY works fine in query analyzer and the process works fine running on other computers, so we don't know if there is something specific about that environment on that one particular server (unable to test right now).
So my suggestion to the original poster is to simply add an ORDER BY if you don't already have one and see if that is the problem.
Hope this helps.
January 22nd, 2003, 03:11 PM
This works just fine but if I took off the WHERE it did not work.
SELECT * FROM dbo.Project WHERE (ProjectNumber = 'X12345')
I tried this and I get the same error.
SELECT * FROM dbo.Project ORDER BY ProjectNumber
I am pulling back say 20,000 - 30,000 records but I readlly do not need to do this because I am making use of the disconnected database structure of ADO.NET.
I am using using SQL Server 7 on win2k server it is a pretty beefy machine so I know hardware is not an issue. You said you updated the mdac drivers but I do not think this is an issue of mdac drivers. It almost acts like while it is retrieving records it disconnects in the middle of the process after a certain length of time like 2 to 5 seconds.
I think it is either working as designed and not documented or it is a bug since there has not been any Service Packs on this yet I am sure there are still bugs.
I have diagnosed everything from server to network to local system and can not place my finger on why it chokes or disconnects from the datasource while retrieving messages..
April 29th, 2004, 12:45 PM
I was having similar problems. Some of the posts in this thread pointed me towards the right direction.
Initially I thought it was record size. When I trapped the error, long running queries that worked correctly in Query Analyzer would crash after 30 seconds in the VB.NET application.
There is a property in the SQLCommand object called CommandTimeout. The default time is 30 seconds. When I changed the value to 180 seconds, everything worked.
myCmd.CommandTimeout = 180
April 29th, 2004, 12:50 PM
Thanks for the post back. Wow this is an old post I have since then went a different direction with my program but am glad you posted the Timeout code makes sence.
March 22nd, 2005, 05:16 PM
Don't Confuse the Errors
You are referring to a SQLTIMEOUT exception. This thread is discussing General Network Exception.
Totally different animal.
June 10th, 2005, 10:12 AM
I have the same kind of Error
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionCheckForData (CheckforData()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
My Query is
select * from Table order by Name
But if i tried with
select * from Table order by Field
select * from Table
What i got is, if i tried order by with field name 'name'
i got this error.
June 10th, 2005, 12:22 PM
krs - post your code. Take out any sensitive information like servernames, tables, usernames, and passwords, and replace with a generic name like "source = 'SERVER'". Let us see what you're doing.
February 12th, 2014, 07:35 AM
General network error
I can confirm that I was waiting for a stored procedure to end, and I was getting a "general network error" instead of an error mentioning some tipe of timeout. I've resolved it by setting the command timeout too.
February 24th, 2014, 09:59 AM
Let's not resurrect a 10-year old thread. Topic closed.
I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton