I have a dataset objds. objds contains a table named Table1. Table1 contains column named ProcessName. This ProcessName contains repeated names.So i want to select only distinct names.Is this possible.
intUniqId[i] = (objds.Tables[0].Rows[i]["ProcessName"].ToString());
it is easy
and dt2 datatable contain column1,Column2..ColumnNth unique data.
sthing like ?
SELECT DISTINCT .... FROM table WHERE condition
http://www.felixgers.de/teaching/sql/sql_distinct.html
note: Homework question ? and god bless google..
http://www.google.com/search?hl=en&rlz=1C1GGLS_enJO330JO333&q=c%23+selecting+distinct+values+from+table&aq=f&oq=&aqi=
The most simple solution is use linq and then transform the result to a DataTable
This is valid for asp.net 4.0 ^ Framework if I remeber.
With LINQ (.NET 3.5, C# 3)