【发布时间】:2016-10-20 13:36:12
【问题描述】:
我正在尝试使用以下代码:-
using (AdomdConnection conn = new AdomdConnection(_connString))
{
conn.Open();
Console.WriteLine(conn.ConnectionString);
Console.WriteLine(conn.Cubes.Count);
}
无论有无conn.Open() 行都会引发以下错误:-
A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running.
我正在使用的客户端计算机上没有可用的 SQL Browser 服务。但让我烦恼的是,这个完全相同的连接字符串在 Excel 中工作,并拉回一组 OLAP Cube 度量值,我可以根据需要对其进行调整。
连接字符串如下:-
Provider=MSOLAP.4;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=RaptorMarketRiskSummary;Data Source=ssasp-raptor\plnqic01_as;MDX Compatibility=1;Safety Options=2;MDX Missing Member Mode=Error
有人有什么想法吗?
非常感谢。
【问题讨论】:
-
请看here
-
@lokusking - 谢谢。但是,我试图弄清楚为什么连接字符串可以通过 Excel OLAP 数据透视连接工作,而不是来自 .Net 中的 AdomdConnection。提到的 SQL Browser 服务是可以在服务器上运行的东西。在我看来,如果我可以从 Excel 连接(并且不需要 SQL 浏览器),我应该能够在 .Net 中做同样的事情。
标签: c# ado.net mdx olap olap-cube