Time out on procedure calling from C# code
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Time out on procedure calling from C# code

  1. #1
    Join Date
    Nov 2001
    Location
    Kerala,India
    Posts
    650

    Time out on procedure calling from C# code

    I am calling one procedure in SQL Server from my C# application. This procedure is returning 5 tables from the database. When the filter date is less its working fine from application. But when the between dates are high, its returning the tables in less than 5 milliseconds when i execute from database, but when i try to run the procedure from C# code and get a data set object its showing time out error. what may be the reason. can any one help.
    Do rate this post if it find useful to you

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,373

    Re: Time out on procedure calling from C# code

    Did you try to increase the CommandTimeout?
    Victor Nijegorodov

  3. #3
    Join Date
    Nov 2001
    Location
    Kerala,India
    Posts
    650

    Re: Time out on procedure calling from C# code

    Quote Originally Posted by VictorN View Post
    Did you try to increase the CommandTimeout?
    My problem somewhat solved by setting the command time out to higher value. But still i have a major issue in place. When i run the procedure direct from sql server with the input values it runs very fast in less than 1 second, but when its called through the application its taking more than 1 minute to complete the execution and fill the data set. can you help me in fixing this scenario.
    Do rate this post if it find useful to you

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,272

    Re: Time out on procedure calling from C# code

    How do you access the tables? Do you call the tables directly? Are you calling a stored procedure?

  5. #5
    Join Date
    Jun 2013
    Location
    Santa Clara, USA
    Posts
    2

    Re: Time out on procedure calling from C# code

    Are you using any transactions in your stored procedure? Uncommitted transactions will cause this exact error message.+
    Do you have access to SQL Profiler (doesn't come with Express edition) to get both actual execution plans? If not you can follow the advice in this answer to get the plans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center