Wikis > C# Wiki > DataView (DataSet)
System.Data.DataView _DataView = new System.Data.DataView(_DataSet.Tables[0]);
_DataView.Sort = "Order ASC";

foreach (System.Data.DataRowView _DataRowView in _DataView)
{

  switch (_DataRowView[1].ToString())
  {
  }

}


//DISTINCT

System.Data.DataView _DataView = new System.Data.DataView(_DataSet.Tables["TableName"]);
System.Data.DataTable _DataTable = _DataView.ToTable(true, "Column");
foreach (System.Data.DataRow _DataRow in _DataTable.Rows)
{ } // End: foreach


//SUM

object _sumObject;
_sumObject = table.Compute("Sum(Total)", "EmpID = 5");
Category: Tags: