Knight Data Access Layer
Loading By Stored Procedure VB.NET
Basic Tasks VB.NET > Loading Data > Loading By Stored Procedure VB.NET

Results from Stored Procedures can be automatically mapped to objects.  An example is below.

 

'Get the current instance of the helper

Dim db As IDataHelper = DataHelper.SessionFactory()

 

'Setup the parameters

Dim storedProcedure As String = "GetAll_Customers"

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

parms.Add("@CustomerType", 1)

 

Dim list As List(Of Customer) = db.LoadFromSproc(Of Customer)(storedProcedure, parms)