Click here to Skip to main content
Click here to Skip to main content

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.

Introduction

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

Background

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.

License

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

Share

About the Author

MEmerson
Web Developer
United States United States
No Biography provided

Comments and Discussions

 
Questiondata reader replacement Pinmemberrob boree24-Aug-11 9:21 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141223.1 | Last Updated 4 Oct 2005
Article Copyright 2005 by MEmerson
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid