5,420,997 members and growing! (14,292 online)
Email Password   helpLost your password?
Database » Database » General     Intermediate

ADOMD.NET DataAdapter / DataReader replacement

By MEmerson

This code replaces the buggy ADOMD.NET DataAdapter and DataReader.
C#, Windows, .NET, Visual Studio, DBA, Dev

Posted: 4 Oct 2005
Updated: 4 Oct 2005
Views: 21,167
Bookmarked: 13 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
5 votes for this Article.
Popularity: 2.24 Rating: 3.20 out of 5
1 vote, 20.0%
1
0 votes, 0.0%
2
1 vote, 20.0%
3
1 vote, 20.0%
4
2 votes, 40.0%
5

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

About the Author

MEmerson



Occupation: Web Developer
Location: United States United States

Other popular Database articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 1 of 1 (Total in Forum: 1) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralImprovementmemberwekrato3:49 1 Feb '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 4 Oct 2005
Editor: Smitha Vijayan
Copyright 2005 by MEmerson
Everything else Copyright © CodeProject, 1999-2008
Web13 | Advertise on the Code Project