데이터 세트를 통합하고 나는 1에 이러한 데이터 세트를 병합해야하는 방법 :정렬 순서는 아래 그림과 같이 내가이 데이터 집합을
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 –