Knight Data Access Layer
Execute Stored Procedures VB.NET
Basic Tasks VB.NET > Database Commands > Execute Stored Procedures VB.NET

Any stored procedure can be executed.  It is possible to execute scalar and non query stored procedures with output parameters.  See ExecuteScalarSproc and ExecuteNonQuerySproc for more information.  To load records from a stored procedure, see Loading By Stored Procedure.

 

'Get the current instance of the helper

Dim db As IDataHelper = DataHelper.SessionFactory()

 

'Parameters

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

parms.Add("ExpirationType", "Credit Card")

Dim storedProcedure As String = "CalculateAverageTransactionSale"

 

Dim results As Decimal = Convert.ToDecimal(db.ExecuteScalarSproc(storedProcedure))