■ DataViewManager 클래스를 사용해 DataView를 구하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
using System.Data; #region DataView 구하기 - GetDataView(dataSet, tableName) /// <summary> /// DataView 구하기 /// </summary> /// <param name="dataSet">DataSet</param> /// <param name="tableName">테이블명</param> /// <returns>DataView</returns> public DataView GetDataView(DataSet dataSet, string tableName) { DataViewManager dataViewManager = new DataViewManager(dataSet); return dataViewManager.CreateDataView(dataSet.Tables[tableName]); } #endregion #region DataView 구하기 - GetDataView(dataSet, tableIndex) /// <summary> /// DataView 구하기 /// </summary> /// <param name="dataSet">DataSet</param> /// <param name="tableIndex">테이블 인덱스</param> /// <returns>DataView</returns> public DataView GetDataView(DataSet dataSet, int tableIndex) { DataViewManager dataViewManager = new DataViewManager(dataSet); return dataViewManager.CreateDataView(dataSet.Tables[tableIndex]); } #endregion |