SQLExpress 2008 R2 + Winforms Application + Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ;

Answered SQLExpress 2008 R2 + Winforms Application + Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ;

  • Sunday, January 13, 2013 3:44 PM
     
     

    Hi All,

    User is using winform application with SQL express. Application is working fine and suddenly he was seeing exception  window with data extraction error.

    Exception details are :Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ; SQL exception number is -2.

    Within fraction of seconds if user hits F5 application is working without any issues. I don't see any help online except that exception number -2 means firewall is blocking the connection.

    I wanted to either reproduce the issue on my end or wanted to know exact reason for the error. Appreciate your response.

    Thanks

All Replies

  • Sunday, January 13, 2013 9:02 PM
    Moderator
     
     Answered

    Hello,

    Try to set the CommandTimeout property on the SQLCommand object to a greater value.

    Make sure your application is not leaving connections open.

    Hope this helps.

     Regards,

     Alberto Morillo
    SQLCoffee.com

  • Tuesday, January 15, 2013 12:10 AM
    Moderator
     
     Answered

    Would you please check-out

    http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout(v=vs.90).aspx


    FAQ
    ----
    Regards,
    Ahmed Ibrahim
    SQL Server Setup Team
    My Blog
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you.
    This can be beneficial to other community members reading the thread.
    View Ahmed Ibrahim's profile on LinkedIn