简体   繁体   English

如何为我的AdomdConnection设置连接超时?

[英]How do I set the connection timeout for my AdomdConnection?

I've read thoroughly about AdomdConnection but can't find how to set the Connection Timeout in my connection string. 我已经彻底阅读了有关AdomdConnection的内容,但是找不到在我的连接字符串中设置连接超时的方法。 My current connection string is as follows: 我当前的连接字符串如下:

Data Source=MySSAS;Initial Catalog=MyCatalog

But no matter what I do, any variation of Connection Timeout , ConnectionTimeout , Connect Timeout or ConnectTimeout doesn't seem to change my connection ( MSDN) 但是无论我做什么, Connection TimeoutConnectionTimeoutConnect TimeoutConnectTimeout任何变化似乎都不会改变我的连接( MSDN)

I observe the connection properties in my debugger and always see the getter value of the ConnectionTimeout as 0: 我在调试器中观察到连接属性,并且始终将ConnectionTimeout的getter值视为0:

在此处输入图片说明

Needles to say that the property has no setter. 针说该财产没有二传手。

Does anyone know how to set it? 有人知道如何设置吗? I'm only interested in the connection timeout, not command timeout. 我只对连接超时感兴趣,对命令超时不感兴趣。

I found the answer over at MSDN - SSAS Client Connection Timeout : 我在MSDN-SSAS客户端连接超时中找到了答案:

In msmdsrv.ini: <InitialConnectTimeout>10</InitialConnectTimeout> 在msmdsrv.ini中:<InitialConnectTimeout> 10 </ InitialConnectTimeout>

Perhaps you can verify what SQL does by running a trace when you connect: 也许可以通过在连接时运行跟踪来验证SQL的作用:

在此处输入图片说明

Or it maybe even though you are seeing Connection Timeout = 0 in Visual Studio on the client the value on the server could be different. 或者,即使您在客户端上的Visual Studio中看到“ Connection Timeout = 0 ,服务器上的值也可能不同。

Also dont forget you could resort to pinging the server for a minute as an alternative to the Connection Timeout setting. 同样不要忘记,您可以尝试对服务器执行ping操作一分钟,以替代“连接超时”设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM