Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using Visual Studio 2015, the Microsoft Analysis Client Dll is version 11 which I have refrence, how ever when I import the namespace it state there is not a public member.

I simply want to open a adomd connection and issue the mdx query cmd. I cannot get passed opening the connection.

What I have tried:

see code below:

imports Microsoft.AnalysisServices.adomdclient
Imports System

Public Class _Default
    Inherits Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
EventArgs) Handles Me.Load

    End Sub

    Protected Sub GridView4_SelectedIndexChanged(sender As Object, e
As EventArgs) Handles GridView4.SelectedIndexChanged
        Get_Answer()
    End Sub
    Sub Get_Answer()
        Dim conn As New AdomdConnection("Data Source=SQLDEV1;Catalog=pl_360_ii")
        Dim cmd As String
        cmd = "SELECT NON EMPTY { [Measures].[Revenue Amount] } ON
COLUMNS FROM ( SELECT ( { [Shipment Date].[Shipment Year].&[2017] } )
ON COLUMNS FROM [pl_360_ii]) WHERE ( [Shipment Date].[Shipment
Year].&[2017] ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR,
FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS"
        Dim dataAdapter As New AdomdDataAdapter(cmd, conn)
        Dim ds As New DataSet()
        dataAdapter.Fill(ds)
        queryresultview.DataSource = ds.Tables(0)
Posted
Updated 14-Apr-17 22:39pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900