Re: "Timeout expired. " when using Fill Method
From: William \(Bill\) Vaughn (billvaRemoveThis_at_nwlink.com)
Date: 06/28/04
- Next message: Nate Clark: "Re: Access DB grows too fast."
- Previous message: William \(Bill\) Vaughn: "Re: Access DB grows too fast."
- In reply to: Shawn: ""Timeout expired. " when using Fill Method"
- Next in thread: Rajesh Gutta: "Re: "Timeout expired. " when using Fill Method"
- Reply: Rajesh Gutta: "Re: "Timeout expired. " when using Fill Method"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 28 Jun 2004 14:58:18 -0700
Well, there are many issues to consider here so just setting the
CommandTimeout to a higher number (or infinity--which I rarely recommend)
might only make matters worse. You need to investigate why you're timing
out. Is the query too complex? Is the query processor waiting for resources?
Is it blocked by other operations (even temporarily)? Are you returning too
many rows?
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Shawn" <Shawn@discussions.microsoft.com> wrote in message
news:C67C8A7E-20D6-4AED-8A96-8F6AD1A93E2A@microsoft.com...
> Once a while, my web application gets this error message:
> "System.Data.SqlClient.SqlException: Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding."
>
> From the Stack Trace:
> [SqlException: Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.]
> System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
> System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior)
>
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(Comman
dBehavior behavior)
> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
> System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand
command, CommandBehavior behavior)
> System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
>
>
> In the webconfig file, I set the timeout = 3600.
>
> Is there anything I should be aware of? The problem is that it works
sometimes.
>
> Thanks!
>
>
> Here is my code: (it's quite simple.)
>
> Dim myConnection As New
SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connSt
r1"))
> Dim myCommand As New SqlCommand
> With myCommand
> .CommandType = CommandType.StoredProcedure
> .CommandText = "dbo.spABC"
> .Connection = myConnection
> End With
>
> Dim adp As New SqlClient.SqlDataAdapter
> adp.SelectCommand = myCommand
> Dim myTable As New DataTable
> adp.Fill(myTable)
- Next message: Nate Clark: "Re: Access DB grows too fast."
- Previous message: William \(Bill\) Vaughn: "Re: Access DB grows too fast."
- In reply to: Shawn: ""Timeout expired. " when using Fill Method"
- Next in thread: Rajesh Gutta: "Re: "Timeout expired. " when using Fill Method"
- Reply: Rajesh Gutta: "Re: "Timeout expired. " when using Fill Method"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|