|
//datagrid binding display
public void Testing()
{
string commandString = "select{[Measures].[ZHANGSHU],[Measures].[Money]} on columns,{[Area].[Area Name].&[白水],[Area].[Area Name].&[澄城],[Area].[Area Name].&[大uli],[Area].[Area Name].&[Weinan],[Area].[Area Name].&[潼关],[Area ].[Area Name].&[蒲城],[Area].[Area Name].&[华阴],[Area].[Area Name].&[华县],[Area].[Area Name ].&[合阳],[Area].[Area Name].&[韩城],[Area].[Area Name].&[富平]} on rows from [test mdx]";
//string commandString = Session["UserTypePicture"].ToString();
string ss = "Data Source=LOCALHOST;Initial Catalog=TestMDX;Provider=msolap;";
AdomdConnection conn = new AdomdConnection(ss);
Microsoft.AnalysisServices.AdomdClient.AdomdDataAdapter adp = new Microsoft.AnalysisServices.AdomdClient.AdomdDataAdapter(commandString, conn);
DataSet ds = new DataSet();
adp.Fill(ds);
DataGrid1.DataSource = ds.Tables[0].DefaultView;
DataGrid1.DataBind();
} |
|