Check the rows of column is either greater than zero or not
Use function DefaultView
Pass the parameters true for distinct, and create new string for giving columns
if (dt1.Rows.Count > 0)
{
DataTable dt2 = dt1.DefaultView.ToTable(true, new string[] { "Columnname1", " Columnname2" });
}
0 Comment(s)