//一般取值
foreach (KeyValuePair<string, TempWeek> entry in dicSalesWeek)
{
DataRow newRow = dtSales.NewRow();
newRow["abc"] = entry.Value.abc;
dsSales.Tables[0].Rows.Add(newRow);
}
//取得值得
集合
foreach (string s in
dicSalesWeek .Values)
{
//s即為集合值之一
string a=s;
}
詳細用法參考:
http://createps.pixnet.net/blog/post/32375859-c%23-dictionary%E7%94%A8%E6%B3%95