主题:  请问Command对象的 CommandTimeout通常什

lfg

职务:普通成员
等级:1
金币:0.0
发贴:27
#12002/10/24 14:57:59
请问Command对象的 CommandTimeout通常什么情况下使用比较合适?

先谢谢啦~~(豪迈的抱抱拳请求状!)



5D荣誉版主

职务:普通成员
等级:1
金币:10.0
发贴:271
#22002/10/24 15:33:31
看看罗:
Use the CommandTimeout property on a Connection object or Command object to allow the cancellation of an Execute method call, due to delays from network traffic or heavy server use. If the interval set in the CommandTimeout property elapses before the command completes execution, an error occurs and ADO cancels the command. If you set the property to zero, ADO will wait indefinitely until the execution is complete. Make sure the provider and data source to which you are writing code support the CommandTimeout functionality.

The CommandTimeout setting on a Connection object has no effect on the CommandTimeout setting on a Command object on the same Connection; that is, the Command object's CommandTimeout property does not inherit the value of the Connection object's CommandTimeout value.

On a Connection object, the CommandTimeout property remains read/write after the Connection is opened.



lfg

职务:普通成员
等级:1
金币:0.0
发贴:27
#32002/10/24 15:41:49
dtmyou在上个帖子中说
引用:
看看罗:
..... If you set the property to zero, ADO will wait indefinitely until the execution is complete.........

这点看起来有点可怕!!

其默认值是不是 0

再次谢谢你 :)



5D荣誉版主

职务:普通成员
等级:1
金币:10.0
发贴:271
#42002/10/24 15:49:12
sorry,forget one thing:

Sets or returns a Long value that indicates, in seconds, how long to wait for a command to execute. Default is 30.



lfg

职务:普通成员
等级:1
金币:0.0
发贴:27
#52002/10/24 15:55:29
THX VERY VERY~~~



5D荣誉版主

职务:普通成员
等级:1
金币:10.0
发贴:271
#62002/10/24 16:31:14

不用啦