G
Guest
I have a sproc on sql server that I am calling from an asp.net app using the data application block v2 method ExecuteDataSet. The sproc returns data that is bound to a datagrid. The problem is that the command times out when being called through .net but only takes 1-3 sec when run from query analyzer
I've used sql profiler to try to diagnose the problem, here are the results
Command Agent CPU Reads Duratio
------------------------------------------ ------ ----- ------ -------
RptInvRoyalty 126, '2/1/2004', '2/29/2004' SQL QA 562 2187 126
RptInvRoyalty 126, '2/1/2004', '2/29/2004' .net 26578 231648 3053
------------------------------------------ ------ ----- ------ -------
Things I have tried (sa account was used for all tests)
- Executing the command as an sproc by passing the sproc name and the parameters to the executedataset method
- Executing the command using CommandType.Text and passing the same string I use in query analyzer (for example: "dbo.MySp 5, '01/02/2004'")
- Executing the command by creating my own SqlCommand and other objects directly (as opposed to using SqlHelper)
- Executing the command using the oledb data provider
- Increasing both the command timeout and connection timeout to 120 sec for all of the above
- Running the command against a backup db. It works the first couple times but then starts timing out
- Running the command from different web servers
- Running both web server and db server on same machine
- Creating a new sproc with the same tsql code
- Using ExecuteReader and ExecuteNonQuery
- Running it in both c# and vb
- Stopping and starting the db server
- Rebooting the db server
Any help would be appreciated
Thanks
Josh
I've used sql profiler to try to diagnose the problem, here are the results
Command Agent CPU Reads Duratio
------------------------------------------ ------ ----- ------ -------
RptInvRoyalty 126, '2/1/2004', '2/29/2004' SQL QA 562 2187 126
RptInvRoyalty 126, '2/1/2004', '2/29/2004' .net 26578 231648 3053
------------------------------------------ ------ ----- ------ -------
Things I have tried (sa account was used for all tests)
- Executing the command as an sproc by passing the sproc name and the parameters to the executedataset method
- Executing the command using CommandType.Text and passing the same string I use in query analyzer (for example: "dbo.MySp 5, '01/02/2004'")
- Executing the command by creating my own SqlCommand and other objects directly (as opposed to using SqlHelper)
- Executing the command using the oledb data provider
- Increasing both the command timeout and connection timeout to 120 sec for all of the above
- Running the command against a backup db. It works the first couple times but then starts timing out
- Running the command from different web servers
- Running both web server and db server on same machine
- Creating a new sproc with the same tsql code
- Using ExecuteReader and ExecuteNonQuery
- Running it in both c# and vb
- Stopping and starting the db server
- Rebooting the db server
Any help would be appreciated
Thanks
Josh