Time out expired

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

i have a table data of 3 millions. When i try to populate the dataset from sqlcommand object or dataadapter it gives my following error

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

I checked iis the timeout is 20 mins i think its enough and i tried setting commandtimeout, but still its giving me same error


What is the solution?

Regards
Yaseen
 
Yaseen,

put this in your web.config, and it will increase your script time out to
900 seconds.

<system.web>
<httpRuntime executionTimeout="900" />
</system.web>

--
Hope this helps,
Zeeshan Mustafa, MCSD


Yaseen D M said:
Hi,

i have a table data of 3 millions. When i try to populate the dataset from
sqlcommand object or dataadapter it gives my following error
Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding. at
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior,
RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

I checked iis the timeout is 20 mins i think its enough and i tried
setting commandtimeout, but still its giving me same error
 
Yaseen,

This timeout has nothing to do with IIS. It as has to do with the timeout
on your SqlCommand, which I think defaults to 30 seconds. You can either
extend this timeout through the timeout property on the command, or in the
connection string, but I suggest that if you are getting sqlcommand timeouts
while returning 3 million rows, that you might want to rethink your strategy
and retreive a much smaller sampling of you data.

Wells

Yaseen D M said:
Hi,

i have a table data of 3 millions. When i try to populate the dataset from
sqlcommand object or dataadapter it gives my following error
Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding. at
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior,
RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

I checked iis the timeout is 20 mins i think its enough and i tried
setting commandtimeout, but still its giving me same error
 
Remeber that there's both a Command Timeout and a Connection Timeout. Based
on your other post (unless this is a different issue), you may be having one
or both problems. 3 million records in a query is absurd in the context you
are doing this. Even if you fix that, you are headed for disaster.
Remember that this all gets cached locally if you are using a datatable (and
even if you're using a Reader it's still nuts). You can't possibly need 3
million records in one page view. Anything else you do is simply going to
be cosmetic. It may 'fix' it, but attack the source of them . Even if you
need 3 million in a session, page or something but there are better
strategies than this. Or just turn up the timeout to about 3 hours.

HTH,

Bill

--

W.G. Ryan, eMVP

http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
Yaseen D M said:
Hi,

i have a table data of 3 millions. When i try to populate the dataset from
sqlcommand object or dataadapter it gives my following error
Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding. at
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior,
RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

I checked iis the timeout is 20 mins i think its enough and i tried
setting commandtimeout, but still its giving me same error
 
Back
Top