M
Miha Markic [MVP C#]
Hi,
I would go with a simple foreach (DataRow row in table.Rows) loop.
I would go with a simple foreach (DataRow row in table.Rows) loop.
Miha Markic said:Hi,
I would go with a simple foreach (DataRow row in table.Rows) loop.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
M K said:I have a Datatable in a DataSet that for one part of the process I need to
know the count of DISTINCT/UNIQUE values in one column. How can I achieve
this.
Sasidhar said:Miha,
May be I am not getting you. How can you do that using a foreach? Can you
please explain.
MK,
Look at this article. You can utilise it to find out the count.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;326176
Or if the number of rows is less then you can use a for loop and a
hashtable. As you loop insert into hashtable. If you find a duplicate
ignore
the key. At the end you can just get the count from hashtable.
-SP
Miha Markic said:Hi,
I would go with a simple foreach (DataRow row in table.Rows) loop.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
M K said:I have a Datatable in a DataSet that for one part of the process I need to
know the count of DISTINCT/UNIQUE values in one column. How can I achieve
this.