I am trying to connect to a cube using C#. When I connect it through my aspx page it works without any issues. But I would like to do it using code. I tried this code - but I am not able to do it. Please let me know what I should fix..
This is my aspx page
<tlrk:RadPivotGrid AllowFiltering="true" AllowSorting="true" ID="RadPivotGrid1" Width="100%"
RowTableLayout="Tabular" FieldsPopupSettings-AggregateFieldsMinCount="2" AllowPaging="true"
PageSize="20" runat="server" EnableConfigurationPanel="true" EnableZoneContextMenu="true"
AggregatesPosition="Rows" EnableToolTips ="true" Skin="Vista">
<PagerStyle AlwaysVisible="true" />
<OlapSettings ProviderType="Adomd"> </OlapSettings>
<RowHeaderCellStyle Width="100%" />
<ConfigurationPanelSettings Position="left" LayoutType="Stacked" DefaultDeferedLayoutUpdate="true" />
<ClientSettings EnableFieldsDragDrop="true"><Scrolling AllowVerticalScroll="false" ScrollHeight="1000px" /> </ClientSettings>
</tlrk:RadPivotGrid>
And in my c# I did this -
protected void Page_Load(object sender, System.EventArgs e)
{
SetupAdomdConnection();
}
private void SetupAdomdConnection()
{
AdomdDataProvider provider = new AdomdDataProvider();
AdomdConnectionSettings settings = new AdomdConnectionSettings();
settings.Cube = "cubeName";
settings.Database = "DBName";
settings.ConnectionString = "Provider=MSOLAP;Data Source=XXXXX;Initial Catalog=DBName;";
provider.ConnectionSettings = settings;
}
This is my aspx page
<tlrk:RadPivotGrid AllowFiltering="true" AllowSorting="true" ID="RadPivotGrid1" Width="100%"
RowTableLayout="Tabular" FieldsPopupSettings-AggregateFieldsMinCount="2" AllowPaging="true"
PageSize="20" runat="server" EnableConfigurationPanel="true" EnableZoneContextMenu="true"
AggregatesPosition="Rows" EnableToolTips ="true" Skin="Vista">
<PagerStyle AlwaysVisible="true" />
<OlapSettings ProviderType="Adomd"> </OlapSettings>
<RowHeaderCellStyle Width="100%" />
<ConfigurationPanelSettings Position="left" LayoutType="Stacked" DefaultDeferedLayoutUpdate="true" />
<ClientSettings EnableFieldsDragDrop="true"><Scrolling AllowVerticalScroll="false" ScrollHeight="1000px" /> </ClientSettings>
</tlrk:RadPivotGrid>
And in my c# I did this -
protected void Page_Load(object sender, System.EventArgs e)
{
SetupAdomdConnection();
}
private void SetupAdomdConnection()
{
AdomdDataProvider provider = new AdomdDataProvider();
AdomdConnectionSettings settings = new AdomdConnectionSettings();
settings.Cube = "cubeName";
settings.Database = "DBName";
settings.ConnectionString = "Provider=MSOLAP;Data Source=XXXXX;Initial Catalog=DBName;";
provider.ConnectionSettings = settings;
}