Knight Data Access Layer
Load Top N Records VB.NET
Basic Tasks VB.NET > Loading Data > Load Top N Records VB.NET

Load a limited number of records.

'Get the current instance of the helper

Dim db As IDataHelper = DataHelper.SessionFactory()

 

Dim parameters As New Dictionary(Of String,Object)()

parameters.Add("@FirstName", "Dan")

Dim list As List(Of Person) = db.LoadTop(Of Person)("WHERE FirstName = @FirstName", parameters, "ORDER BY LastName",1)