Connection timeout in SMO ServerConnection
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
回答
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2021-05-07 《数学模型》(第5版) 张瑞@中国科大
2021-05-07 图论建模
2021-05-07 狼羊过河问题
2021-05-07 NEW SECRET “???” ACHIEVEMENT AND CARD BACK FROM BARRENS – MYSTERIES OF THE PHOENIX – FULL SOLUTION INSIDE!
2021-05-07 凤凰之谜卡背 new card back "secrets of the phoenix"
2020-05-07 git switch
2020-05-07 Reentrant mutex可重入互斥锁