Hi..I hav one approach which somehow finds the result..dont know
whether it is the right way or not..i am writing down the code for it..
Hashtable hs = new Hashtable();
ArrayList arr = new ArrayList();
foreach (DataRow dr in dt.Rows)
{
try
{
hs.Add(dr["Brand"],string.Empty); //only one BMW
will be added here
}
catch
{
arr.Add(dr["Brand"]); //duplicate values will be
added here
}
}
Response.Write(hs.Count); //will show the no of duplication
items for each product
Response.WriteLine(arr.Count);
If u will find any other solution just post it n group..
Thanks..
igotyourdotnet wrote:
How can i loop through my dataset if if colum 1 is there more then once
group them together
example:
dataset looks like this
BMW
BMW
BMW
LEXUS
LEXUS
I want to show BMW once, and Lexus 1 but count the number of time they are
there
so
like this as my output
Cars Sales
BMW 3
LEXUS 2