PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Web Developer ConnectionTimeOut
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Web Developer ConnectionTimeOut
![]() |
Web Developer ConnectionTimeOut |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hello,
I've got a webpage, done with visual studio express web developer, which shows the result of a store procedure. I've got a problem, that sometimes my sql server 2000 replies with the results of the stored procedure quickly enough, but sometimes it's busy and the CommandTimeout of 60000 is not enough. The webserver brings me a logon prompt after quite a while as if I'm not logged on to the remote server, but not the results. Do you know of any other ways to prolong timeout and wait up for the result? SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = mySQLCommand; DataSet ds = new DataSet(); myConnection.Open(); da.SelectCommand.CommandTimeout = 60000; da.Fill(ds, "spRun"); Regards, Mantvydas |
|
|
|
#2 |
|
Guest
Posts: n/a
|
You could set it to 0 so it did not time out...
-- ____________________________________ William (Bill) Vaughn Author, Mentor, Consultant, Dad, Grandpa Microsoft MVP INETA Speaker www.betav.com www.betav.com/blog/billva Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ Visit www.hitchhikerguides.net to get more information on my latest book: Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ----------------------------------------------------------------------------------------------------------------------- "Mantvydas" <mantvydas at gmail dot com> wrote in message news:%23FVeNBJBIHA.3548@TK2MSFTNGP06.phx.gbl... > Hello, > > I've got a webpage, done with visual studio express web developer, which > shows the result of a store procedure. > > I've got a problem, that sometimes my sql server 2000 replies with the > results of the stored procedure quickly enough, but sometimes it's busy > and the CommandTimeout of 60000 is not enough. The webserver brings me a > logon prompt after quite a while as if I'm not logged on to the remote > server, but not the results. Do you know of any other ways to prolong > timeout and wait up for the result? > > SqlDataAdapter da = new SqlDataAdapter(); > da.SelectCommand = mySQLCommand; > DataSet ds = new DataSet(); > myConnection.Open(); > da.SelectCommand.CommandTimeout = 60000; > da.Fill(ds, "spRun"); > > Regards, > Mantvydas |
|
|
|
#3 |
|
Guest
Posts: n/a
|
60000 seconds timeout (1000min, or 16 hours)?!
SqlCommand.CommandTimeout property is counted by second. Are you going to let your weg page waiting the data to be load in possibly 16+ hours? In this case, I think, it is not timed out by your SqlCommand, it is the web server connection timed out (by default, IIS connection timeout is 120 sec.) If web page loading data from database needs more than 20-30 sec, it is already very bad. If your data query is very heavy that needs long time (say, 60 sec, or a few minite), then you should consider asynchorous process, not rely on extending timeout limit to undesirably long. "Mantvydas" <mantvydas at gmail dot com> wrote in message news:%23FVeNBJBIHA.3548@TK2MSFTNGP06.phx.gbl... > Hello, > > I've got a webpage, done with visual studio express web developer, which > shows the result of a store procedure. > > I've got a problem, that sometimes my sql server 2000 replies with the > results of the stored procedure quickly enough, but sometimes it's busy > and the CommandTimeout of 60000 is not enough. The webserver brings me a > logon prompt after quite a while as if I'm not logged on to the remote > server, but not the results. Do you know of any other ways to prolong > timeout and wait up for the result? > > SqlDataAdapter da = new SqlDataAdapter(); > da.SelectCommand = mySQLCommand; > DataSet ds = new DataSet(); > myConnection.Open(); > da.SelectCommand.CommandTimeout = 60000; > da.Fill(ds, "spRun"); > > Regards, > Mantvydas |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Thanks Norman. Yes, I also thought it was one of those "Daddy, where are the
matches?" questions... Yes, I expect the session is timing out (as itshould). -- ____________________________________ William (Bill) Vaughn Author, Mentor, Consultant, Dad, Grandpa Microsoft MVP INETA Speaker www.betav.com www.betav.com/blog/billva Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ Visit www.hitchhikerguides.net to get more information on my latest book: Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ----------------------------------------------------------------------------------------------------------------------- "Norman Yuan" <NoAddress@NoEmail.fake> wrote in message news:O4xmw3RBIHA.4444@TK2MSFTNGP03.phx.gbl... > 60000 seconds timeout (1000min, or 16 hours)?! > > SqlCommand.CommandTimeout property is counted by second. > > Are you going to let your weg page waiting the data to be load in possibly > 16+ hours? > > In this case, I think, it is not timed out by your SqlCommand, it is the > web server connection timed out (by default, IIS connection timeout is 120 > sec.) > > If web page loading data from database needs more than 20-30 sec, it is > already very bad. If your data query is very heavy that needs long time > (say, 60 sec, or a few minite), then you should consider asynchorous > process, not rely on extending timeout limit to undesirably long. > > > "Mantvydas" <mantvydas at gmail dot com> wrote in message > news:%23FVeNBJBIHA.3548@TK2MSFTNGP06.phx.gbl... >> Hello, >> >> I've got a webpage, done with visual studio express web developer, which >> shows the result of a store procedure. >> >> I've got a problem, that sometimes my sql server 2000 replies with the >> results of the stored procedure quickly enough, but sometimes it's busy >> and the CommandTimeout of 60000 is not enough. The webserver brings me a >> logon prompt after quite a while as if I'm not logged on to the remote >> server, but not the results. Do you know of any other ways to prolong >> timeout and wait up for the result? >> >> SqlDataAdapter da = new SqlDataAdapter(); >> da.SelectCommand = mySQLCommand; >> DataSet ds = new DataSet(); >> myConnection.Open(); >> da.SelectCommand.CommandTimeout = 60000; >> da.Fill(ds, "spRun"); >> >> Regards, >> Mantvydas > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Bill,
> You could set it to 0 so it did not time out... > A little change You could set it to 0 so it does never time out......... (I never will advice this). :-) Cor |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

Yes, I expect the session is timing out (as it
