dbTalk Databases Forums  

Using ADOMD.NET to access AS 2005 based on HTTP

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Using ADOMD.NET to access AS 2005 based on HTTP in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Elvis Tang
 
Posts: n/a

Default Using ADOMD.NET to access AS 2005 based on HTTP - 05-22-2006 , 05:13 AM






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>


Reply With Quote
  #2  
Old   
Jeje
 
Posts: n/a

Default Re: Using ADOMD.NET to access AS 2005 based on HTTP - 05-22-2006 , 09:18 AM






what is the security mode of the testmolap virtual directory?
do you have activated the impersonation in the web.config file?
<identity impersonate="true" />

does your code works fine if you use a direct access instead-of http access?


"Elvis Tang" <headsea2005 (AT) gmail (DOT) com> wrote

Quote:
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




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.