tags:

views:

334

answers:

1

I have a chunk of MDX that I'd like to throw into a Asp.Net form. Hopefully just bind the results to a gridview. Anyone know of any good links or snippets? I'm using VB.Net, but am able to port from C# if no VB is available.

A: 

There is a way to execute MDX withing SQL, which I suppose would give you a sneaky way to bind the results to a gridview!

select top 100 * from openrowset(
    'MSOLAP',
    'Datasource=MyDBServerName;Initial catalog=MyCubeName',
    'SELECT {dimensions(0).members} on rows, 
    {time.defaultmember} on columns 
    from sales'
)

There is a proper way of course (used to be called ADOMD in classic ASP, which gave you a Cellset object you could loop around).

Many people use a third-party .NET component, such as the one by Dundas, to show tables and graphs from cube data.

Magnus Smith