[英]Unable to set timeout property for ADOMDConnection class
I am using AdomdConnection connection class to connect to the Cube. 我正在使用AdomdConnection连接类来连接到多维数据集。 I am using following code.
我正在使用以下代码。
using (var conn = new AdomdConnection(ConnString))
{
conn.Open();
var cube = conn.Cubes[name];
//Do something
conn.Close();
}
AdomdConnection.ConnectionTimeout Property does not have setter property. AdomdConnection.ConnectionTimeout属性没有setter属性。
The default value for connectionTimeOut property is 0, which sets the time to infinite. connectionTimeOut属性的默认值为0,它将时间设置为无限。
I have two questions: 我有两个问题:
I looked into this similar tread but did not found it useful. 我研究了类似的踏板,但没有发现它有用。
Thank you 谢谢
The documentation states this for AdomdConnection.ConnectionTimeout
该文档针对
AdomdConnection.ConnectionTimeout
声明了这一点
Gets the time to wait for a connection to be established before the AdomdConnection stops trying to connect and generates an error.
获取在AdomdConnection停止尝试连接并生成错误之前等待建立连接的时间。
So that means the timeout just talking to the server. 因此,这意味着超时仅与服务器通信。
If you want a timeout when your running an actual command use the AdomdCommand.CommandTimeout
property. 如果要在运行实际命令时超时,请使用
AdomdCommand.CommandTimeout
属性。
Gets or sets the time to wait for a command to run before the AdomdCommand stops trying to run the command and generates an error.
获取或设置在AdomdCommand停止尝试运行命令并生成错误之前等待命令运行的时间。
Both can be set with the connection string. 两者都可以使用连接字符串设置。
http://msdn.microsoft.com/en-us/library/microsoft.analysisservices.adomdclient.adomdconnection.connectionstring.aspx http://msdn.microsoft.com/en-us/library/microsoft.analysisservices.adomdclient.adomdconnection.connectionstring.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.