First Step into ADOMD.Net - Cannot reference Micro

2019-04-19 02:08发布

Can someone help me out please, as google is not providing the answers.

I've got a SharePoint 2007 setup which uses SQL Server 2008 R2 SSAS OLAP cubes via some web parts.

As a C# developer, Sharepoint is a nightmare, so I decided I needed to try to get to grips with just C# and OLAP interaction. My cubes all exist, and are working, so all I needed to do was create a simple C# App to get it all straight in my mind.

I've downloaded Microsoft.AnalysisServices v10.0.0.0 and I can see it sitting happily in my GAC, but I can't add a reference from within my Visual Studio 2010 C# 4.0 project. It's just notappearing. I've tried setting the app to use 3.5, but still no joy.

Any clues?

标签: c# adomd.net
4条回答
霸刀☆藐视天下
2楼-- · 2019-04-19 02:17

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);
 }
查看更多
手持菜刀,她持情操
3楼-- · 2019-04-19 02:21

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

查看更多
该账号已被封号
4楼-- · 2019-04-19 02:23

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

查看更多
趁早两清
5楼-- · 2019-04-19 02:37

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
查看更多
登录 后发表回答