locked
ObjectDataSource CommandTimeout RRS feed

  • Question

  • User-1069616273 posted

     I have seen MANY threads on this topic, but still can not find a definitive answer as to how to fix this.

    I am using VB.Net

    1) I have a DAL(we will call it dal.xsd) made up of a TableAdapter (we will call it getsomething)

    2) The getsomething TableAdapter has a query which calls a stored procedure (we will call it sp_getsomething)

    3) I have a webpage(getsomething.aspx) which has a GridView(gdvGetSomething) whos data source is an ObjectDataSource(ObjectDataSource1), which calls the sp_getsomething stored procedure from the getsomething TableAdapter

    PROBLEM:  The execution of the stored procedure takes longer than the default command timeout of 30 seconds

    Question: How and/or where can I raise the Command Timeout value so that I dont get the System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

    I have read several things about creating a partial class, and if this is the case, then where do I put that at?  Do I have to create a new class file?  does it go in the getsomething.vb?  Is there an entry I can put in the web.config?

    Any help would be greatly appreciated.  Thanks!

    Tuesday, March 8, 2011 10:17 AM

All replies

  • User1288251396 posted

    When I get SQL timeouts, it's usually because I've done something wrong other than setting my timeout value too low, e.g. created a bottleneck or a deadlock somewhere.  (My favorite was when I created a trigger that put SQL into an infinite loop. ;-)

    Have you run the same query using the SQL Server admin tool?

    Wednesday, March 9, 2011 3:44 PM