Schema Data from OLAP

csharp United States
  • 17 years ago

    thanks in advance


    I'm using OleDbConnection's GetOleDbSchemaTable method and it returns some information but i don't know how to ask for cubes on the database or dimensions of a cube.


    The code i used in a .aspx file is shown below .


    <%@ Import Namespace="System" %>
    <%@ Import Namespace="System.Data" %>
    <%@ Import Namespace="System.Data.OleDb" %>


    <html>


    <script language="C#" runat="server">


       void Page_Load(Object semder, EventArgs e) {



       OleDbConnection olapConn = new OleDbConnection("Provider=MSOLAP.2;Integrated Security=SSPI;Persist Security Info=False;User ID=usuario;Data Source=local;Location=local;Initial Catalog=FoodMart 2000;Client Cache Size=25;Auto Synch Period=10000") ;
       olapConn.Open();


       object[] Restricciones = new object[]{"CATALOGNAME" , "SCHEMANAME" , "CUBE_NAME" } ;


       DataTable SchemaTable = olapConn.GetOleDbSchemaTable( OleDbSchemaGuid.Tables , Restricciones ) ;


           MyDataList.DataSource = SchemaTable.DefaultView;
           MyDataList.DataBind();
       olapConn.Close();
       }


    </script>


    <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">


     <!-- #include virtual="/quickstart/aspplus/samples/webforms/customize/header.inc" -->


     <ASPataList id="MyDataList" runat="server">


         <ItemTemplate>


             <b>Media Type: </b><%# ((DataRowView)Container.DataItem)[0]  %><br>
             <b>Unit Sales: </b><%# ((DataRowView)Container.DataItem)[2]  %><br>


           </div>


         </ItemTemplate>


     </ASPataList>


     <!-- #include virtual="/quickstart/aspplus/samples/webforms/customize/footer.inc" -->


    </body>
    </html>

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“To iterate is human, to recurse divine” - L. Peter Deutsch