2
データセットをマージして、私は1にこれらのデータセットをマージする必要がありますする方法:ソートし、順序は以下に示すように、私は2つのデータセットを持って
date reason total
12 aug 2010 inactive 123
19 aug 2010 inactive 45
20 sep 2010 inactive 145
02 nov 2010 inactive 95
25 dec 2010 inactive 44
DATASET2
date reason total
12 aug 2010 active 12
21 aug 2010 active 45
20 sep 2010 active 45
02 nov 2010 active 45
26 dec 2010 active 45
私はマージすることができ
DATASET1 Merge
メソッドを使用してDataSetsを作成しますが、このような結果を得るためにDataSetsを並べ替えるにはどうすればいいですか:
// Assuming the merged table is the first and only table in the DataSet.
DataView dv = new DataView(dataSet1.Tables[0]);
dv.Sort = "date, reason DESC";
:
date reason total
12 aug 2010 inactive 123
12 aug 2010 active 12
19 aug 2010 inactive 45
21 aug 2010 active 45
20 sep 2010 inactive 145
20 sep 2010 active 45
02 nov 2010 inactive 95
02 nov 2010 active 45
25 dec 2010 inactive 44
26 dec 2010 active 45
日付列のデータ型とは何ですか?テキストまたは日付?それが日付の場合は、参照してくださいhttp://stackoverflow.com/questions/513961/c-sharp-how-do-i-sort-a-datatable-by-date –