구글검색 DataTable.Select에 그룹방법(DISTINCT)
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/e6f7e2d7-662c-49d1-b56e-71dcd06ddbf5

Q : How??
myTable is a DataTable
DataRow[] DataRows = myTable.Select("DISTINCT FirstName");
return DataRows

A : DataTable.Select is not.
DataTable nonDistinctTable;
// fill the non distinct table...

// If the table has all the data and doesn't need filtering you can do the following...
DataTable distinctTable = table.DefaultView.ToTable("DistinctTable", true, "Col1");

// If the table needs further filtering you can use the DataView to filter, then 'convert' to a DataTable...
DataView view = table.DefaultView;
// set the row filtering on the view...
view.RowFilter = "Col1 = 'XYZ'";
// then get the distinct table...
DataTable distinctTable = view.ToTable("DistinctTable", true, "Col1");

ex --------------------------

  string strDivYstNig = "";

  DataTable dtRepYstNigGrp = ds.Tables[1].DefaultView.ToTable("DistinctTable", true, "CD_NM");
  for (int i = 0; i < dtRepYstNigGrp.Rows.Count; i++)
  {
   string strColNm = dtRepYstNigGrp.Rows[i]["CD_NM"].ToString();
   int iColNm = ds.Tables[1].Select(string.Format(" CD_NM = '{0}' ", strColNm)).Length;
   strDivYstNig += strColNm + ";" + iColNm.ToString() + ";";
  }

  lblMangerNm.Text = strDivYstNig;

Posted by 말없제이
,