Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Timeout

0 views
Skip to first unread message

BrassicaNigra

unread,
Dec 9, 2009, 11:16:01 AM12/9/09
to
I have a GridView that uses a SqlDataSource.Select command to fill with data
(asp.net 2.0). The user can specify a date range for the select statement
and when the query returns a very large number of rows, I receive the
following error
message after about 30 seconds;

'The timeout period elapsed prior to completion of the operation or the
server is not responding.'

I have tried increasing the Connection Timeout in the SQL Connection String,
but
that did not make any difference.

Again, this works fine if the number of rows is smaller.

What do I need to do to correct this?

Thanks,

Dale Hoffman

Gregory A. Beamer

unread,
Dec 9, 2009, 12:01:05 PM12/9/09
to
=?Utf-8?B?QnJhc3NpY2FOaWdyYQ==?= <brassic...@community.nospam> wrote
in news:3E223625-78FA-442A...@microsoft.com:

> What do I need to do to correct this?

One easy thing is increasing the timeout for BOTH the connection and the
command. But this is not necessarily the best option.

Reducing the amount of data is another option, if possible.

You might also look at the protocols installed on SQL Server and make
sure you have the proper one installed for your app. While named pipes
may work in many instances, it can take longer in others. The same is
true for other protocols. Play around with this a bit and you might find
this is all that is the issue.

I would also recommend profiling SQL Server as it can give you some
information on where the failure is actually occuring. Is the command
being run and timing out or is only the connection being established.
Understanding the true problem will reduce time to solution.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************

Vince Xu [MSFT]

unread,
Dec 9, 2009, 9:43:52 PM12/9/09
to
Hello Dale,

This timeout error is associated with CommadTimeOut rather than
ConnectTimeOut. So you need change the CommandTimeOut property of your
SqlCommand object.
The ConnectTimeout Property of a connection string determines how long a
SqlConnection Object runs before it stops attempting to connect to a server.


--
Sincerely,

Vince Xu

Microsoft Online Support


==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

MSDN Managed Newsgroup support offering is for non-urgent issues where an
initial response from the community or a Microsoft Support Engineer within
2 business day is acceptable. Please note that each follow up response may
take approximately 2 business days as the support professional working with
you may need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================

--------------------

BrassicaNigra

unread,
Dec 10, 2009, 12:19:01 PM12/10/09
to
How do I set the Command Timeout for aSqlDataSource.Select?

"Vince Xu [MSFT]" wrote:

> .
>

Vince Xu [MSFT]

unread,
Dec 14, 2009, 5:00:17 AM12/14/09
to
Hello,

You can do it like this way. You can set it in Selecting event of
SqlDataSource.

protected void SqlDataSource1_Selecting(object sender,
SqlDataSourceSelectingEventArgs e)
{
e.Command.CommandTimeout = 30;
}

--------------------
| Thread-Topic: Timeout
| thread-index: Acp5vN237LSypexBRhCi4wq4sKIIPQ==
| X-WBNR-Posting-Host: 74.95.112.177
| From: BrassicaNigra <brassic...@community.nospam>
| References: <3E223625-78FA-442A...@microsoft.com>
<wehtlKUe...@TK2MSFTNGHUB02.phx.gbl>
| Subject: RE: Timeout
| Date: Thu, 10 Dec 2009 09:19:01 -0800
| Lines: 67
| Message-ID: <9AE6DFA8-377E-4785...@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:94988
| NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Vince Xu [MSFT]

unread,
Dec 17, 2009, 4:45:21 AM12/17/09
to
Hi,

Did you resolve this issue?

--

Sincerely,

Vince Xu

Microsoft Online Support

--------------------
| X-Tomcat-ID: 53877879
| References: <3E223625-78FA-442A...@microsoft.com>
<wehtlKUe...@TK2MSFTNGHUB02.phx.gbl>

<9AE6DFA8-377E-4785...@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain

| Content-Transfer-Encoding: 7bit
| From: v-vi...@online.microsoft.com (Vince Xu [MSFT])
| Organization: Microsoft
| Date: Mon, 14 Dec 2009 10:00:17 GMT
| Subject: RE: Timeout
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <50sqHRKf...@TK2MSFTNGHUB02.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 93
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:95047
| NNTP-Posting-Host: tk2tomimport1.phx.gbl 10.230.18.247

0 new messages