Re: damn messag"Timeout expired.The timeout period elapsed prior to completion of th by William
William
Sun Nov 23 01:18:54 CST 2003
For a quick fix, you can adjust the Timeout property of your command object
to 60 seconds or however long you'll need --- The default value is 30
seconds, so if it takes 45 in QA, then this isn't surprising.
This will fix your immediate needs, but I'd seriously look at why a query is
taking 45 seconds. That's a long time and in most instances, users don't
want to wait that long. Even if you have it running in a background thread,
I'd look at an indexing strategy (although you want to do this with a trace
b/c Adding indexes can definitely speed up queries, but they need to be
thought out. After all, everything performance wise in a Database is a
tradeoff rather htan an either/or"
Anywya, try myCommand.CommandTimeout = 60 (or whatever number you know will
be enough for the query to finish)
Cheers,
Bill
"Meiny" <mahmudi58@hotmail.com> wrote in message
news:037901c3b186$74dfe4b0$a401280a@phx.gbl...
> When I'm Runung An insert Sql Stored procedure on SQL
> SERVER after some seconds this message is handled.
> I have tested this SP on Query Analyzer more and more,the
> execution time in Query Analyzer is about 45 seconds.
> But in my program , the progarm stop responding and then
> this exception thrown.
> the original message is:
> "Timeout expired. The timeout period elapsed prior to
> completion of the operation or the server is not
> responding."
>