Connection timeout in SMO
回答1
Apparently ServerConnection also has a statement timeout. SMO is full of these hidden timeouts. Including SQLBulkCopy. However, thanks to @Derek for pointing this out. The answer is you have to set the StatementTimeout = 0. I am testing this now but it appears to be the answer.
How to set CommandTimeout
问题
I am using Microsoft.SqlServer.Management.Smo
.
My Code:
Server server = new Server(new ServerConnection( new SqlConnection(ConnectionString));
server.ConnectionContext.ExecuteNonQuery(script);
I want to set CommandTimeout
for it like we do with normal SQLCommand
Please tell me how to set CommandTimeout
for queries running through Microsoft.SqlServer.Management.Smo.Server
回答