Results 1 to 2 of 2

Thread: Bottom 10 records

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2008
    Location
    South Africa
    Posts
    395

    Bottom 10 records

    How can i select the bottom 10 records in my table. Does the BOTTOM keyword work in VB.NET?

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

    Re: Bottom 10 records

    If you're using .NET 3.5 then you can use LINQ to DataSet:
    vb.net Code:
    1. Dim last10Rows = myDataTable.AsEnumerable().Skip(myDataTable.Rows.Count - 10)
    The converse of Skip is Take, so to get the first 10 rows would be .Take(10).
    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