我有問題開發Windows移動應用程序使用C#,我試圖與3查詢工作。 我想收集所有結果查詢到詞典。在字典中存儲查詢結果
我可以收集它沒有循環?
像這樣我的代碼:
string query= "select distinct nameProduct, price from product";
SqlCeCommand cmd = new SqlCeCommand(sql, dbConn);
Dictionary production = new Dictionary<string, int>();
如何設置這個產量從我的查詢,becausei有一個過程3這樣的查詢和數據是超過10000。當我嘗試這個,我得到錯誤「{」沒有數據存在的行/列。「}」但實際上,當我嘗試在sql服務器中的查詢仍然運行良好。該行中的錯誤:production [(string)reader [「nameProduct」]] =(int)reader [「price」];
@Johnny: 不幸的是,這個項目在VS2005中構建,不支持union和join語句。
你的問題來從數據庫和存儲數據的數據是很不清楚 – 2011-12-21 02:25:26
如果這是10K時間找出一些不同的東西。 – Will 2011-12-21 02:52:39
您如何看待(a,11.0)(a,12.0) – shenhengbin 2011-12-21 03:04:05