Page view counter

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

Rate It (1)

Last post 09-08-2006 5:10 AM by Gordon-Freeman. 3 replies.

Sort Posts:

  • Timeout expired. [While running an Stored Procedure from windows application]

    09-07-2006, 7:15 AM
    • Loading...
    • Iftikhar
    • Joined on 09-13-2005, 9:41 AM
    • UK
    • Posts 72
    • Points 310

    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

     

    Ahmad
    UK
    Filed under:
  • Re: Timeout expired. [While running an Stored Procedure from windows application]

    09-07-2006, 10:29 AM
    Answer
    • Loading...
    • Gordon-Freeman
    • Joined on 07-17-2006, 4:19 AM
    • SH, PRC
    • Posts 909
    • Points 4,635

    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

    你好! Just FYI o_O
  • Re: Timeout expired. [While running an Stored Procedure from windows application]

    09-08-2006, 4:53 AM
    Answer
    • Loading...
    • Iftikhar
    • Joined on 09-13-2005, 9:41 AM
    • UK
    • Posts 72
    • Points 310

    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

    Ahmad
    UK
  • Re: Timeout expired. [While running an Stored Procedure from windows application]

    09-08-2006, 5:10 AM
    • Loading...
    • Gordon-Freeman
    • Joined on 07-17-2006, 4:19 AM
    • SH, PRC
    • Posts 909
    • Points 4,635
    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~
    你好! Just FYI o_O
Page 1 of 1 (4 items)