Hi there,
I am using the SQL managed provider in ADO.NET to fill a dataset with a large number of records. I periodically get an exception with the description "General Network Error" when trying to fill the dataset. The problem occurs rarely. I've searched Google and have seen many posts dealing with this problem. The typical culprits are:
Network Problems: A bad cable, NIC, or router can cause this problem. In my case, however, both the ADO.NET application and SQL Server 2000 are running on the same machine which eliminates network problems as a cause.
Connection Pooling: Some people recommend turning connection pooling OFF to resolve this problem. Others recommend turning it ON to resolve the problem. In my case, it is on. All pool size values are default.
Stale Connection: The problem can be caused when SQL Server 2000 is restarted, placing pooled connections in a bad state. In my case, however, I am not restarting SQL Server too frequently. When I do restart it, I restart my .NET app too to ensure that there aren't any stale connections hanging around [I'm assuming that the "pool" lives within the process of my .NET app?]
I'm stumped. The only thing that I can think of is DNS. My connection string contains a DNS entry. Presumably if DNS lookup failed, a General Network Error might occur, so I'm eliminating DNS from the equation by changing the server name to '127.0.0.1'. My gut tells me that this isn't the problem though. The DNS server is a domain controller on my internal network. DNS shouldn't be the problem.
Any other ideas?
--
Sincerely,
David Sworder
http://www.CodeFanatic.com