Distinct Sql??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • perspolis

    Distinct Sql??

    Hi everybody
    is it possible to use Distict sql in DataTable.or DataView..
    for example dt.DefaultView. RowFilter="Dist inct Code";
    ??


  • Nicholas Paldino [.NET/C# MVP]

    #2
    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.co m

    "perspolis" <rezarms@hotmai l.com> wrote in message
    news:OLbZ500aFH A.2860@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Hi everybody
    > is it possible to use Distict sql in DataTable.or DataView..
    > for example dt.DefaultView. RowFilter="Dist inct Code";
    > ??
    >
    >[/color]


    Comment

    Working...