Connecting Tech Pros Worldwide Forums | Help | Site Map

Distinct Sql??

perspolis
Guest
 
Posts: n/a
#1: Nov 17 '05
Hi everybody
is it possible to use Distict sql in DataTable.or DataView..
for example dt.DefaultView.RowFilter="Distinct Code";
??



Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
#2: Nov 17 '05

re: Distinct Sql??


perspolis,

No, it is not. However, you can write a function to do this for you
easily. Basically, you would sort the table (through a data view) on the
distinct fields in the table. Then, cycling through the rows, you would
check to see when the values change among the fields you are getting
distinct values for. If it changes, then you store the set of values, and
move on.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"perspolis" <rezarms@hotmail.com> wrote in message
news:OLbZ500aFHA.2860@TK2MSFTNGP10.phx.gbl...[color=blue]
> Hi everybody
> is it possible to use Distict sql in DataTable.or DataView..
> for example dt.DefaultView.RowFilter="Distinct Code";
> ??
>
>[/color]


Closed Thread