Knight Data Access Layer
LoadFromSproc(String) Method
Example 




KellermanSoftware.NetDataAccessLayer Namespace > IDataHelper Interface > LoadFromSproc Method : LoadFromSproc(String) Method
The stored procedure to execute
Get a list of records using the passed Stored Procedure
Syntax
Overloads Function LoadFromSproc( _
   ByVal storedProcedure As String _
) As List(Of Dictionary(Of String,Object))
Dim instance As IDataHelper
Dim storedProcedure As String
Dim value As List(Of Dictionary(Of String,Object))
 
value = instance.LoadFromSproc(storedProcedure)

Parameters

storedProcedure
The stored procedure to execute

Return Value

A list of dictionary records
Example
//Get the current thread static safe instance of the helper
SqlServerProvider provider = new SqlServerProvider();
 
//Specify User Name and License Key from the receipt, leave blank for trial mode
//db.UserName = "John Smith 1234";
//db.LicenseKey = "asdfl219==";
 
//Log to the console
db.EnableLogging();
 
//Open the database connection
db.OpenConnection();
 
string storedProcedure = "GetTopTenCustomers";
 
List<Dictionary<string,object>> records = db.LoadFromSproc(storedProcedure);
 
db.CloseConnection();
'Get the current thread static safe instance of the helper
Dim provider As New SqlServerProvider()
 
'Specify User Name and License Key from the receipt, leave blank for trial mode
Dim connnectionString As String = "Data Source=TestServer;Initial Catalog=TestDatabase;Integrated Security=SSPI;"
'db.LicenseKey = "asdfl219=="
 
'Log to the console
db.EnableLogging()
 
'Open the database connection
db.OpenConnection()
 
Dim storedProcedure As String = "GetTopTenCustomers"
 
Dim records As List(Of Dictionary(Of String,Object)) = db.LoadFromSproc(storedProcedure)
 
db.CloseConnection()
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IDataHelper Interface
IDataHelper Members
Overload List