Results 1 to 2 of 2

Thread: How to get Distinct rows from dataset

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    91

    How to get Distinct rows from dataset

    Hi

    i am having a dataset with a Table which contains repeated values in rows.

    i need to get Distinct field value

    like

    my DS contains 5 records

    with


    FileLocation :C:\\test

    i should get only one record with FileLocation :C:\\test

    thanks
    Vinay Kumar

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to get Distinct rows from dataset

    If you want distinct rows then you need to do that with your SQL code when you retrieve the data in the first place. Once the data is in a DataTable it's too late. There is no inbuilt way to filter out duplicate rows in a DataTable, so you'd have to write code to loop and test.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width