First Step into ADOMD.Net - Cannot reference Microsoft.AnalysisServices

本秂侑毒 提交于 2019-12-05 00:43:53

Have you added the reference for Microsoft.AnalysisServices.AdomdClient.dll located in C:\Program Files\Microsoft.NET\ADOMD.NET\100

Themba Mabaso

You could also use the nuget package manager. Type this in the console

Deprecated version (does not exist anymore):

    install-package Microsoft.AnalysisServices.AdomdClient

New version:

    Install-Package Microsoft.AnalysisServices.AdomdClient.retail.amd64

I think you need to reference the file directly, rather than through the GAC. It should be located in C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies

user3904340

AdomdConnection steps

AdomdConnection con = new AdomdConnection("connectionstring");   // connect DB  
con.Open();
AdomdCommand cmd = new AdomdCommand("MDX query", con); //query

AdomdDataReader reader = cmd.ExecuteReader(); //Execute query

while (reader.Read())   // read
{
    Data dt = new Data();  // custom class
    dt.Gender = reader[0].ToString();

    dt.Eid = reader[1].ToString();
    dt.salary = reader[2].ToString();
    data.Add(dt);
 }
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!