Web Developer ConnectionTimeOut

  • Thread starter Thread starter Mantvydas
  • Start date Start date
M

Mantvydas

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
 
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)
 
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.
 
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 it
should).

--
____________________________________
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)
-----------------------------------------------------------------------------------------------------------------------
 
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
 
Back
Top