如何设置的CommandTimeout [英] How to set CommandTimeout

查看:2150
本文介绍了如何设置的CommandTimeout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Microsoft.SqlServer.Management.Smo

我的代码:

Server server = new Server(new ServerConnection( new SqlConnection(ConnectionString));
server.ConnectionContext.ExecuteNonQuery(script);

我想设置的CommandTimeout 它就像我们做正常的SqlCommand

I want to set CommandTimeout for it like we do with normal SQLCommand

请告诉我如何设置的CommandTimeout 通过 Microsoft.SqlServer.Management.Smo.Server 运行查询

Please tell me how to set CommandTimeout for queries running through Microsoft.SqlServer.Management.Smo.Server

推荐答案

尝试的 server.ConnectionContext.StatementTimeout

这篇关于如何设置的CommandTimeout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆