What are the timeouts that can be set in asp.net

G

George Homorozeanu

I have an ASP.Net application that works with MS SQL Server in background to
show some infomartions to the users. I also have build the functionality for
downloading this information in a CSV-Format file. If I set the shown
information over a short period of time (lets say 1 year) then the download
work god. If I set a longer period (5 years --> more infos to show and
download) then I can still see the inforamtion but I can't download it. I
get an "The page cannot be shown" error.

I thing that there is a timeout problem but I don't know which timeouts can
be set in asp.net.

Any answer could help me a lot.

Thanks.
 
B

Bruce Barker

look at

the sqlcommand query timeout
the asp.net page has a timeout

-- bruce (sqlwork.com)
 
G

Guest

It could be sql timeouts. I've had queries run in the past which go beyond
the defaults and fail. I think the default query timeout is something like
30 seconds, and the connection timeout is 15 but they can be changed in
code.

in C#

SqlConnection con = new SqlConnection();
SqlCommand cmd = new SqlCommand();

cmd.Connection.ConnectionTimeout = 30;
cmd.CommandTimeout = 45;

Using DataAdapters would look something like

adp.SelectCommand.Connection.ConnectionTimeout = 30;
adp.SelectCommand.CommandTimeout = 45;

If you have it try running the same query it would produce in SQL Query
Analyzer. It will not timeout on a long query and will give a value of
seconds taken which should help.

If you are using them you can also set Session variables timeout in
web.config (initially 20 minutes) or individually withSession.Timeout = 40

There are probably more but those are the ones that spring to mind.
 
J

Juan T. Llibre

Hi, George.

There's a useful "trick" which can help you
find out *all* possible timeout settings.

If you're using .Net Framework 1.1, navigate
to the .Net Framework CONFIG directory :

drive:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG

There, open machine.config with Notepad,
and save it as machine.config.xml

Now, double-click machine.config.xml. It will open in IE.

It's easy, now, to search for "timeout", and see what the different timeouts
refer to ( the file is well-commented, and explains what each "timeout" setting
refers to ).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top