Getting field datatypes from a SQL Analysis Services MDX SELECT query using .NET AdomdClient

34 views Asked by At

Let's say I have this MDX query against SQL Server's Analysis Service Adventure Works sample:

select [Measures].[Customer Count] on columns, 
[Date].[Calendar Quarter of Year] on rows
from [Adventure Works]

And I execute it as:

var reader = new AdomdCommand("...").ExecuteReader();

I would expect that

reader.GetFieldType(0);

would return System.Int32, but it returns System.Object. The same is true if I query schema with reader.GetSchemaTable() which is no surprise as I assume the former gets data from later. I also assume this is probably not an exclusive .NET issue. The same is at least true for .NET Framework.

So, is there a way I can get those types when I do a query?

0

There are 0 answers