locked
Timeout expired. [While running an Stored Procedure from windows application] RRS feed

  • Question

  • User1408051640 posted

    Hi,

    I am getting following error while trying to execute a Stored Procedure using Microsoft Application Blocks [Data Access Block]

    "Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."

    If I run the Stored Procedure from SQL management Studio, it takes 00:01:20 [hh:mm:ss]  but works. In my Windows application the same SP throws an exception with the above mentioned error message just after 31 seconds everytime.

     Any help, ideas on this?

     

    Regards

     

    Thursday, September 7, 2006 7:15 AM

Answers

  • User-1936818034 posted

    Yes, the default timeout is 30s... You may try:

    1. Plus "Timeout=XX" in your connection string, where XX is seconds
    2. Set both Connection.ConnectionTimeout and Command.ConnectionTimeout

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 7, 2006 10:29 AM
  • User1408051640 posted

    Hi,

     Thanks it worked!

    I am surprised why we need to set both? It should be possible to use the Connection.ConnectionTimeout by Command Object. Anyway, I can run my query now.

     

    Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 8, 2006 4:53 AM

All replies

  • User-1936818034 posted

    Yes, the default timeout is 30s... You may try:

    1. Plus "Timeout=XX" in your connection string, where XX is seconds
    2. Set both Connection.ConnectionTimeout and Command.ConnectionTimeout

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 7, 2006 10:29 AM
  • User1408051640 posted

    Hi,

     Thanks it worked!

    I am surprised why we need to set both? It should be possible to use the Connection.ConnectionTimeout by Command Object. Anyway, I can run my query now.

     

    Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 8, 2006 4:53 AM
  • User-1936818034 posted
    Seems Connection.Timeout is limited to that specified in connection string, while Command.Timeout has nothing to do with connection... I'm also a little puzzled why ms leave us with 2 timeouts, but usually just set Command.Timeout >= Connection.Timeout it's okay~
    Friday, September 8, 2006 5:10 AM
  • User-754841418 posted

    Hi,

    I have been suffering from last two months for the session expiry.
    We have developed one website for the client, all the handover is done but we are not able to close the same due to reports displaying issue. Reports page is getting expired after 60secs.

    I have tried using the above method but still no way.

    Can you help me for the same.

    Thanks 

    Sunday, December 5, 2010 5:53 PM