SqlCommand.CommandTimeout seems to have no effect
- From: Chris Miller <ChrisMiller@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 10 Oct 2008 06:22:00 -0700
Hi,
I am trying to set the CommandTimeout property in the .NET SqlCommand object
to less than the default 30 secs. I might also want it to be more than 30
secs. Running a query results in the query not terminating as expected, it
continues until completion.
For example, if I set the CommandTimeout to 5, a query that takes 3 minutes
will complete, which is not expected.
My Sql Server (2000) query timeout is set at 600. I have tried setting this
lower (i.e. 10 sec) but the query will still complete
I was expecting to see an exception (TIMEOUT EXPIRED), but also no exception
is generated.
Does anybody know the rules surrounding this property, for example, does the
sql server always take presedence, is setting less than 30 in the
CommandTimeout valid? (i.e. not 0 for infinite)?
I have seen a lot of conflicting posts about this topic, so if anybody has
come across similar issues or knows how this works, thanks in advance
.
- Follow-Ups:
- Re: SqlCommand.CommandTimeout seems to have no effect
- From: Mary Chipman [MSFT]
- Re: SqlCommand.CommandTimeout seems to have no effect
- Prev by Date: Re: What is the best way to copy a database
- Next by Date: Re: SqlCommand.CommandTimeout seems to have no effect
- Previous by thread: VS 2008 Data Access Issues
- Next by thread: Re: SqlCommand.CommandTimeout seems to have no effect
- Index(es):
Relevant Pages
|