Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timeout expired - SqlDataSource

Status
Not open for further replies.

rdgerken

Technical User
Jul 8, 2002
108
Guys/Gals,

I have a GridView bound to a SqlDataSource control in my page. From remote locations, I have no problems running my stored procedure that the SqlDataSource is pointing to. However, sometimes when I first open the page, I get a "Timeout expired" error. (Strangly, this problem happens more at the local terminal than it does from a remote terminal). After researching this, most folks say I need to set a larger timeout value for the Command.

First question is, is this what I need to do?

Secondly, how can I do this if I'm not setting up the GridView<->SqlDataSource in code (I'm just setting the GridView up using the smart tags to use the DataSource) - so it doesn't seem that I have access to this Command object anywhere to even get to the timeout property - timeout or command doesn't seem to be a part of the SqlDataSource control, or if it is, I don't know how to get to it.

TIA for your help!
 
I created an OnSelecting event for the SqlDataSource object, and then I was able to get access to the command object there in the event arguments to set the timeout.

Hope this helps someone in the future.
 
It may help t setup your connection manually using the sqlclient.


second the timeout can be set on the sql server itself. go to EM right click on your server then goto properties. set your query timeouts..
 
I think I tried that originally, but then I think I lost a lot of the "built-in" features of the gridview when I broke this connection, and set it up manually - (such as the sorting and paging) - can you set up the connection manually and still setup the sorting and paging too? I'm not sure how to do that.
 
I believe that the link you referenced me to covers details of the datagrid control. I'm using the gridview control, and I'm trying to take advantage of the built-in sorting and paging functionality - but I don't know how to do this without linking it to a datasource at designtime. I'm sure a lot of the semantics are the same as the datagrid, but I'd like to be a little more specific to the sorting/paging functionality of the gridview (without setting the datasource at design time).

Thanks for the input though!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top