HighTechTalks DotNet Forums  

Re: Timeout while running a sql

Dotnet Framework (ODBC.net) microsoft.public.dotnet.framework.odbcnet


Discuss Re: Timeout while running a sql in the Dotnet Framework (ODBC.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Bob Grommes
 
Posts: n/a

Default Re: Timeout while running a sql - 08-28-2003 , 11:36 AM






This is a question better posted to
microsoft.public.dotnet.framework.adonet, but you already answered your own
question. If it's timing out on a lengthy operation, then the solution is
to increase the timeout to a value that will exceed the longest that this
operation could take.

This is done by setting the CommandTimeout property of your SqlCommand
object. I believe the default is 30 seconds.

--Bob

"wolf" <xiaozhimin1978 (AT) 163 (DOT) com> wrote

Quote:
When I try to restore a database via SqlCommand.ExecuteNoneQuery(), a
SqlException exception thrown. The message about the exception is:

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

But the same commandtext run correctly in the Sql Query Analyzer.

What shall I do to run this command correctly?

Thanks!





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.