![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I build a simple ASP.NET web application, and want to use ADOMD.NET to access AS 2005 based on HTTP. But I failed. Who can help me why the code can not work? I use Basic Authentication on IIS and impersonation is enabled in web.config. The logon user can access the AS database because I succeeded in testing by PivotTable based on HTTP. %@ Page Language="C#" % %@ Import Namespace="System.Web" % %@ Import Namespace="Microsoft.AnalysisServices.AdomdClient" % script RunAt="server" protected void btnTest_Click(object sender, EventArgs e) { string connStr = @"Provider=MSOLAP; Data Source=http://localhost/testmolap/msmdpump.dll; Initial Catalog=Adventure Works DW"; string cmdText = "SELECT [Measures].[Internet Gross Profit] ON COLUMNS FROM [Adventure Works]"; try { AdomdConnection conn = new AdomdConnection(connStr); conn.Open(); AdomdCommand cmd = new AdomdCommand(cmdText, conn); CellSet cellSet = (CellSet)cmd.Execute(); txtMessage.Text += "Result : " + cellSet[0].Value.ToString(); conn.Close(); } catch (Exception ex) { txtMessage.Text += "Error Message : " + ex.Message; txtMessage.Text += "\nStack Trace : \n"; txtMessage.Text += ex.StackTrace; } } /script form runat="server" asp:Button ID="btnTest" runat="server" OnClick="btnTest_Click" Text="Test"></asp:Button br asp:TextBox ID="txtMessage" runat="server" TextMode="MultiLine" Height="600px" Width="1000px"></asp:TextBox /form |
![]() |
| Thread Tools | |
| Display Modes | |
| |