简体   繁体   English

进入 ADOMD.Net 的第一步 - 无法引用 Microsoft.AnalysisServices

[英]First Step into ADOMD.Net - Cannot reference Microsoft.AnalysisServices

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.我有一个 SharePoint 2007 设置,它使用 SQL Server 2008 R2 SSAS OLAP 多维数据集通过一些 Z2567A5EC9705EB7AC2C9884033E06189DZ 部件。

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.作为一名 C# 开发人员,Sharepoint 是一场噩梦,所以我决定只需要尝试掌握 C# 和 OLAP 交互。 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.我的多维数据集都存在并且正在工作,所以我需要做的就是创建一个简单的 C# 应用程序,以便将其全部记在心里。

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.我已经下载了 Microsoft.AnalysisServices v10.0.0.0,我可以在我的 GAC 中愉快地看到它,但我无法在我的 Visual Studio 2010 C# 4.0 项目中添加引用。 It's just notappearing.它只是没有出现。 I've tried setting the app to use 3.5, but still no joy.我尝试将应用程序设置为使用 3.5,但仍然没有乐趣。

Any clues?有什么线索吗?

Have you added the reference for Microsoft.AnalysisServices.AdomdClient.dll located in C:\Program Files\Microsoft.NET\ADOMD.NET\100您是否添加了位于 C:\Program Files\Microsoft.NET\ADOMD.NET\100 中的Microsoft.AnalysisServices.AdomdClient.dll的参考

You could also use the nuget package manager.您还可以使用 nuget package 管理器。 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

AdomdConnection steps AdomdConnection 步骤

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);
 }

I think you need to reference the file directly, rather than through the GAC.我认为您需要直接引用该文件,而不是通过 GAC。 It should be located in C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies它应该位于 C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies

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

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