Re: Help! how to get the content of each cell in a CellSet?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Akshai Mirchandani [MS] (akshaim_at_online.microsoft.com)
Date: 09/24/04


Date: Fri, 24 Sep 2004 11:41:38 -0700

Re-cycling post:

FYI, accessing cells in an ADOMD cellset in C# turns out to have a slightly
strange syntax when doing interop. For example,

     object[] pos = new object[1];
     pos[0] = System.Convert.ToInt16(cellOrdinal); // cellOrdinal
is the ordinal of the cell in the cellset

     ADOMD.Cell cell = cstResult.get_Item(ref pos); // cstResult is
the ADOMD cellset object

The get_Item method requires an array of objects -- you can either pass in a
single element containing the cell ordinal of the required cell, or you can
pass an array of axis positions with the coordinate of the cell.

HTH
Akshai

--
This posting is provided "AS IS" with no warranties, and confers no rights
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
"Zhang JiDong" <jdzhang@iflytek.com> wrote in message
news:e2QhdXgoEHA.3172@TK2MSFTNGP10.phx.gbl...
> hi,
>    In ASP.NET + OLAP + ADOMD, I wrote codes as follows:
>     (I don't know how to get the content of each cell in a CellSet)
>
>
>    ADODB.Connection oDB = new ADODB.Connection();
>    ADOMD.Cellset oMDCS = new ADOMD.Cellset();
>    oDB.Open("provider=msolap;data source=localhost","", "", 0);
>    oDB.DefaultDatabase = "Foodmart 2000";
>
>    oMDCS.ActiveConnection = oDB;
>
>    string szMDX = "SELECT {[Measures].members} ON COLUMNS, NON EMPTY
> [Store].[Store City].members ON ROWS  FROM Sales";
>    oMDCS.Open(szMDX, oDB);
>
>     //   How to get the content of each cell in the oMDCS ???
>
>
>
>


Relevant Pages