Microsoft Knowledge Base Email Alertz

(887126) - Explains that when you set the CommandTimeout property of the SqlCommand class to zero, you may receive a General Network Error. Provides a resolution that explains that the CommandTimeout property must be set to a larger value such as 7200.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 887126 - Last Review: October 15, 2004 - Revision: 1.2

Setting the SqlCommand.CommandTimeout property to zero may cause a General Network Error

SYMPTOMS

The CommandTimeout property of the SqlCommand class is set to zero. Zero is an infinite timeout. When a response from an instance of Microsoft SQL Server is broken into more than one network packet, the connection will be incorrectly closed, and a General Network Error will occur.

RESOLUTION

To resolve this problem, use one of the following methods:
  • Use a large value such as 7200 for the CommandTimeout property.
  • Apply the hotfix in the following Microsoft Knowledge Base article:
    823679  (http://kbalertz.com/Feedback.aspx?kbNumber=823679/ ) FIX: Multiple fixes for SQL Server .NET Data Provider
Note This problem occurs in both the Microsoft .NET Framework 1.0 and the Microsoft .NET Framework 1.1. However, the hotfix is only available for the .NET Framework 1.1.

STATUS

This behavior is by design.

MORE INFORMATION

You can detect this problem in a network monitor trace if you run a query, and then you retrieve more than one packet of data at a time. By default, the SqlClient packet size is 8 kilobytes (KB). However, in the network monitor trace the packet may appear as multiple physical network packets that total 8 KB when added together. After you receive the first packet, the connection is closed with an ACK+FIN packet. SQL Server will continue to send data afterward. The behavior causes a TCP/IP connection reset and causes the error.

REFERENCES

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
827422   (http://kbalertz.com/Feedback.aspx?kbNumber=827422/ ) How to troubleshoot connectivity issues in SQL Server 2000
875285   (http://kbalertz.com/Feedback.aspx?kbNumber=875285/ ) TechNet Support WebCast: Known connectivity issues related to "General Network Error" error messages

APPLIES TO
  • Microsoft .NET Framework 1.1
  • Microsoft .NET Framework 1.0
Keywords: 
kbsqlclient kbconnectivity kbtshoot kbprb KB887126
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate