16

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?

Chris Kemp
  • 2,069
  • 2
  • 18
  • 27
  • Have you downloaded the [ADOMD.NET library](http://www.microsoft.com/download/en/details.aspx?id=23089) from Microsoft? It's an extension to ADO.NET to get in touch with MDX stuff – marc_s Jul 07 '11 at 13:30

4 Answers4

27

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

Bharathi
  • 1,015
  • 13
  • 41
  • 1
    This worked for my client, after executing the installer from the section titled "Microsoft® SQL Server® 2012 ADOMD.NET" at the following URL: http://www.microsoft.com/en-us/download/confirmation.aspx?id=29065 (my folder was "\Program Files\Microsoft.NET\ADOMD.NET\110") – Mazrick Jul 24 '12 at 20:46
  • Any idea why it can't pick this assembly up automatically? – fijiaaron Sep 25 '12 at 14:59
  • can anybody tell me how/where do I add this reference please – pythonian29033 May 16 '13 at 13:34
  • @fijiaaron, it will only show up automatically in the references browser if the library was registered in the global assembly cache. – Brian Scott Nov 14 '13 at 15:30
  • 1
    Directory name `100` maps to SQL Server 2008 installation. It could be different depending upon which version of SQL Server Analysis Services (SSAS) server is installed on your box. Various mappings are detailed [here](https://stackoverflow.com/questions/18753886/sql-server-file-names-vs-versions) – RBT Jun 30 '17 at 10:36
12

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
Arya Aghaei
  • 495
  • 9
  • 22
Themba Mabaso
  • 411
  • 4
  • 12
  • Thanks Themba, I am working on asp.net mvc application and this worked for me. – Gurusinghe Oct 23 '15 at 08:08
  • I'm glad i could help – Themba Mabaso Oct 24 '15 at 20:26
  • I wish I could use this rather than having a specific DLL referenced in the filesystem. I have a .net2.0 application that I can add the reference to directly, but if I try to use Nuget, I get the following error: Install-Package : Could not install package 'Microsoft.AnalysisServices.AdomdClient 12.0.2000.8'. You are trying to install this package into a project that targets '.NETFramework,Version=v2.0', but the package does not contain any assembly references or content files that are compatible with that framework. – Ads May 03 '16 at 04:57
  • I'm not to sure but you should probably update your .Net framework to the latest one. If you have it already install the 3.5 version see if that works – Themba Mabaso May 07 '16 at 05:49
  • The nuget package is named "...amd64" which sounds like a processor to me. Any other Adomd client from microsoft is deprecated. Which is the Adomd client and how to download it? (February 2020) – LosManos Feb 07 '20 at 15:30
0

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);
 }
Noel Widmer
  • 4,444
  • 9
  • 45
  • 69
0

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

Dave
  • 3,581
  • 1
  • 22
  • 25
  • I'll give it a go, but I'm pretty sure that the deployment routine already pushes DLLs into SQL server directories. Thanks. – Chris Kemp Jul 11 '11 at 16:55