Hello,
Thank you M. Dean for your valuable help.
The query is very long and contains if's and else's..
 
I did not understand what to do about your second tip : "set the CommandTimeout 
on the SelectCommand for the data adapter."

Would you please clarify more..

Thank you

Imane


Dean Fiala <[EMAIL PROTECTED]> wrote:
the timeout in web.config is for the session time out, not the
connection time out

You can set the connection timeout in the connection string when you
create your SqlConnection object

ConnString ="Server=localhost;pwd=blah;uid=blah;connection timeout=30"

the timeout is in seconds.

But this just sets how long .NET waits before throwing an error when
trying to connect to the server.

What you want to set is the CommandTimeout on the SelectCommand for
the data adapter.  The default is 30 seconds.

You should consider doing is
a) rewriting your query
b) indexing your tables more effectively
c) both a & b

especially if it is a commonly used query, this will frustrate your
users and choke your server.  A query should run that long if there is
no way around it.



On 4/27/05, imane elfechtani <[EMAIL PROTECTED]> wrote:
> 
> Hello everybody,
> 
> I have a huge search query that when run the .net ( using a try catch) gives 
> me this error:
> 
> System.Data.SqlClient.SqlException: Timeout expired. The timeout period 
> elapsed prior to completion of the operation or the server is not responding. 
> at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior 
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at 
> System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at 
> System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior
>  behavior) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, 
> Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, 
> CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet 
> dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand 
> command, CommandBehavior behavior) at 
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, 
> Int32 maxRecords, String srcTable) at VOM.villaResultsWODates.BuildGrid() in 
> c:\inetpub\wwwroot\vom\villaresultswodates.aspx.cs:line 506
> 
> I have tried everything from google but it didn't work
> I tried setting the timeout in web.config to 2000 but same problem
> 
> Help plz !
> 
> Imane
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> 
> [Non-text portions of this message have been removed]
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 


-- 
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com


---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
  
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to