PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Web Developer ConnectionTimeOut

Reply

Web Developer ConnectionTimeOut

 
Thread Tools Rate Thread
Old 02-10-2007, 02:05 AM   #1
Mantvydas
Guest
 
Posts: n/a
Default Web Developer ConnectionTimeOut


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

  Reply With Quote
Old 02-10-2007, 06:05 PM   #2
William Vaughn
Guest
 
Posts: n/a
Default Re: Web Developer ConnectionTimeOut

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


  Reply With Quote
Old 02-10-2007, 06:58 PM   #3
Norman Yuan
Guest
 
Posts: n/a
Default Re: Web Developer ConnectionTimeOut

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


  Reply With Quote
Old 02-10-2007, 10:19 PM   #4
William Vaughn
Guest
 
Posts: n/a
Default Re: Web Developer ConnectionTimeOut

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)
-----------------------------------------------------------------------------------------------------------------------

"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

>


  Reply With Quote
Old 04-10-2007, 05:17 AM   #5
Cor Ligthert[MVP]
Guest
 
Posts: n/a
Default Re: Web Developer ConnectionTimeOut

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
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off