Click here to Skip to main content
13,252,065 members (56,020 online)
Click here to Skip to main content
Add your own
alternative version


26 bookmarked
Posted 4 Oct 2005

ADOMD.NET DataAdapter / DataReader replacement

, 4 Oct 2005
Rate this:
Please Sign up or sign in to vote.
This code replaces the buggy ADOMD.NET DataAdapter and DataReader.


This code replaces the exceptionally buggy ADOMD.NET DataReader and DataAdapter classes.


I am writing reports in ActiveReports for .NET and am currently porting a large set of reports to Analysis Services and MDX. In the process, I started out using the ADOMD data provider through the ADO data adapter. I discovered that this interface has a bug where you cannot query properties of parent-child dimensions. This was reported to MS and after 2 months of trying to get them to confirm it, they finally confirmed that it was a bug and they have no plans to fix it. This bug also appears in ADOMD.NET. After discovering that you also cannot query intrinsic properties of the measures dimension, I decided that I needed to write my own data provider. I started out using the ADOMD.NET Cellset as the data source, but that has a bug where it will crash on certain queries with a DuplicateNameException (reported to MS, no response yet). I then switched to using ADOMD through COM interop. All of the classes except MyMdDataReader are simple shells and not very interesting. Most of the functionality is enclosed in the MyMdDataReader.

Using the code

This is a direct drop-in replacement for ADOMD.NET if you need to use a DataReader or fill a DataSet from an MDX expression. Just replace references to AdomdDataReader, AdomdDataAdapter, AdomdConnection and AdomdCommand with MyMdDataReader, MyMdDataAdapter, MyMdConnection, and MyMdCommand respectively.

As far as I have tested this, it works with all MDX queries and will return the same column names as the AdomdDataReader. In addition it will return queried parent-child dimension properties, and the following intrinsic properties for all dimensions on the Y axis; CAPTION, CHILD_COUNT, LEVEL_DEPTH, LEVEL_NAME, NAME, UNIQUE_NAME.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

Questiondata reader replacement Pin
rob boree24-Aug-11 9:21
memberrob boree24-Aug-11 9:21 
GeneralImprovement Pin
wekrato1-Feb-06 3:49
memberwekrato1-Feb-06 3:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171114.1 | Last Updated 4 Oct 2005
Article Copyright 2005 by MEmerson
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid