亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

SSAS系列——【08】多維數據(程序展現Cube)

系統 1849 0
原文: SSAS系列——【08】多維數據(程序展現Cube)

1、引用DLL?

????? 按照之前安裝的MS SQLServer的步驟安裝完成后,發現在新建的項目中“Add Reference”時居然找不到Microsoft.AnalysisServices.AdomdClient命名空間,不知道是什么狀況?只好添加DLL了,在“C:\Program Files\Microsoft.NET\ADOMD.NET\100\Microsoft.AnalysisServices.AdomdClient.dll”下找到了該文件,該文件的最后修改時間是2009年3月30日,534KB。如圖:

dll

圖 AdomdClient.dll的磁盤路徑

2、連接字符串?

本人覺得這一塊和ADO.NET沒有太大的區別,此處我使用的連接字符串是:Provider=SQLNCLI10.1;Data Source=localhost;Integrated Security=SSPI;Initial Catalog=BPDW; ,該字符串可以在數據源設計器中找到,所以根本無需記憶,會找即可。

ll

圖 連接字符串

3、第一個程序

?

代碼
        
string ReturnCommandUsingCellSet()
{
// Create a new string builder to store the results
System.
Text .StringBuilder result = new System. Text .StringBuilder();
// Connect to the local server
using (AdomdConnection conn
= new AdomdConnection("Provider = SQLNCLI10. 1 ;Data Source = localhost;Integrated Security = SSPI;Initial Catalog = BPDW;"))
{
conn.
Open ();
// Create a command, using this connection
AdomdCommand cmd
= conn.CreateCommand();
cmd.CommandText
= @" select { [ Measures ] . [ Oil Proved Reserves ] } on columns ,{ [ Dim Time ] . [ 年份 ] . & [ 19 ] } on rows from [ BPDW ] where [ Dim Geography ] . [ 國家名稱 ] . & [ Total Asia Pacific ] & [ China ] ";
// Execute the query, returning a cellset
CellSet cs
= cmd.ExecuteCellSet();
// Output the column captions from the first axis
// Note that this procedure assumes a single member exists per column .
result.Append("\t");
TupleCollection tuplesOnColumns
= cs.Axes [ 0 ] . Set .Tuples;
foreach (Microsoft.AnalysisServices.AdomdClient.Tuple
column in tuplesOnColumns)
{
result.Append(
column .Members [ 0 ] .Caption + "\t");
}
result.AppendLine();
// Output the row captions from the second axis and cell data
// Note that this procedure assumes a two - dimensional cellset
TupleCollection tuplesOnRows
= cs.Axes [ 1 ] . Set .Tuples;
for ( int row = 0 ; row < tuplesOnRows. Count ; row ++ )
{
result.Append(tuplesOnRows
[ row ] .Members [ 0 ] .Caption + "\t");
for ( int col = 0 ; col < tuplesOnColumns. Count ; col ++ )
{
result.Append(cs.Cells
[ col, row ] .FormattedValue + "\t");
}
result.AppendLine();
}
conn.
Close ();
return result.ToString();
}
// using connection
}

?

SSAS系列——【08】多維數據(程序展現Cube)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 91最新免费地址入口 | 9i9精品国产免费久久 | 国产精品视频在 | 天天干天天弄 | 亚洲国产中文字幕在线观看 | 中文字幕在线高清 | 一级毛片免费在线观看网站 | 国产婷婷色一区二区三区 | 日本一级毛片片在线播放 | 亚洲精品乱码一区二区在线观看 | 国产亚洲精品一区久久 | 青青草国产97免久久费观看 | 中文在线不卡 | 嫩模一区 | 久久久久久99 | 亚洲精品综合网 | 二级毛片免费观看全程 | 性色网站| 国产精品毛片 | 日本高清专区一区二无线 | 激情欧美 | 久草在线免费资源 | 日本不卡免费高清一级视频 | 精品一区二区三区在线观看l | 九九视频免费在线观看 | 国外欧美一区另类中文字幕 | 国产精品日韩欧美一区二区 | 波多野结衣高清在线播放 | 色婷婷影视| 成人xxxx| 免费观看男女羞羞的视频网站 | 九一精品 | 天天舔天天插 | 久久综合九色综合欧洲 | 久久亚洲这里只有精品18 | 久久入 | 欧美亚洲综合在线 | 麻豆日韩 | 五月婷婷丁香在线视频 | 午夜影院普通 | 国产精品乱码一区二区三区 |