ExecuteQuery timeout

Thread is closed for posting
2 posts, 0 answers
  1. Remco
    Remco avatar
    4 posts
    Member since:
    Oct 2013

    Posted 15 Jan 2014 Link to this post


    i use this code in my application to execute a store procedure:

    var bookings = DbContext.ExecuteQuery<UserCreditDebit>("SP_CalcUsersCreditDebit").ToList();

    (UserCreditDebit booking in bookings)
    ....  do some stuff

    this work normal very fine.. but if i have a lot of data i get a SQL Timeout error.

    how can i change the timeout ?
    i was found this answer  

    but i don't know how to apply this solution for my query that returns a list as result.

    can somebody give me a hint how to solve this?


  2. Kristian Nikolov
    Kristian Nikolov avatar
    206 posts

    Posted 16 Jan 2014 Link to this post

    Hi Remco,

    Depending on your scenario you can either set the command timeout on a global level, or you can modify the call to your stored procedure in order to apply the approach described in the linked forum thread.

     If your scenario allows you to have a higher global command timeout you can set it by using the Model Settings dialog or specify it in the .config file of your project.

    If you wish to specify the timeout only for the execution of specific stored procedures, you should modify the call to the stored procedures to use OACommands. Then you would be able to apply the approach described in this forum thread.

    I hope this helps. Should you have additional questions feel free to post at our forums again or contact us via our Ticket System.

    Kristian Nikolov
    OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
Back to Top