Hello,
I'm trying to connect to my OLAP Cube with a c# project.
This is my code:
private void Page_Load(object sender, System.EventArgs e)
{
ADODB.ConnectionClass conn=new ConnectionClass();conn.Open(ConfigurationSettings.AppSettings["connection_string"].ToString(),ConfigurationSettings.AppSettings["user_conn"].ToString(),ConfigurationSettings.AppSettings["password_conn"].ToString(),0);
try
{ADOMD.CellsetClass cs=new CellsetClass();
cs.ActiveConnection=conn;
string szMDX="";
szMDX += "SELECT ";
szMDX += "{[Measures].members} ON COLUMNS,";
szMDX += "[CAMPAGNE].[Dim CAMPAGNE].members ON ROWS";
szMDX += " FROM [My Roi]";
cs.Open(szMDX,conn); // here there is an error
}
I've receive this error message:
"Impossible to use this connexion to make this operation, the connexion is closed or invalid in this context".
Can you help me please, because I can't find the problem.
Thanks,
No comments:
Post a Comment