Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 how to use 'select distinct .' to filter a dataset

Author  Topic 

pareekfranksoul
Starting Member

26 Posts

Posted - 2009-03-30 : 07:31:58
i know we can filtering a dataset something like this (very simple example):

DataSet ds = new DataSet();

....(after filling ds with a table)

DataRow[] dr1;
string filter1 = "ID = 23";
dr1 = ds.Tables[0].Select(filter1);

I know we can even use keyword 'Like' in a dataset's filter, but I wonder how to use function like 'select distinct ...' to a dataset?

Many thanks for your help!

ayamas
Aged Yak Warrior

552 Posts

Posted - 2009-04-02 : 09:22:23
No you cannot use distinct or group by function on a dataset.The best way to do is write a customised function in which you create a hash table & put the rows from dataset into it.
Go to Top of Page
   

- Advertisement -