SqlCommand object, what length of time for CommandTimeout?

后端 未结 5 1620
-上瘾入骨i
-上瘾入骨i 2021-01-03 19:58

How do I decide what length of time to use as a timeout when using an SqlCommand object?

On parts of the code I\'m working on (written by somebody else) I have:

5条回答
  •  抹茶落季
    2021-01-03 20:31

    The default value is 30 seconds (http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout.aspx).

    If your database is on the same machine you usually don't have to change it. Just try it out: if you experience connection timeouts increase the value.

提交回复
热议问题