C# Class LightFramework.Data.OleDbHelperParameterCache

OleDbHelperParameterCache provides functions to leverage a static cache of procedure parameters, and the ability to discover parameters for stored procedures at run-time.
Mostrar archivo Open project: xianrendzw/LightFramework.Net

Public Methods

Method Description
CacheParameterSet ( string connectionString, string commandText ) : void

add parameter array to the cache

GetCachedParameterSet ( string connectionString, string commandText ) : System.Data.OleDb.OleDbParameter[]

retrieve a parameter array from the cache

GetSpParameterSet ( string connectionString, string spName ) : System.Data.OleDb.OleDbParameter[]

Retrieves the set of OleDbParameters appropriate for the stored procedure

This method will query the database for this information, and then store it in a cache for future requests.

GetSpParameterSet ( string connectionString, string spName, bool includeReturnValueParameter ) : System.Data.OleDb.OleDbParameter[]

Retrieves the set of OleDbParameters appropriate for the stored procedure

This method will query the database for this information, and then store it in a cache for future requests.

Private Methods

Method Description
CloneParameters ( System.Data.OleDb.OleDbParameter originalParameters ) : System.Data.OleDb.OleDbParameter[]
DiscoverSpParameterSet ( string connectionString, string spName, bool includeReturnValueParameter ) : System.Data.OleDb.OleDbParameter[]

resolve at run-time the appropriate set of OleDbParameters for a stored procedure

OleDbHelperParameterCache ( ) : System

Method Details

CacheParameterSet() public static method

add parameter array to the cache
public static CacheParameterSet ( string connectionString, string commandText ) : void
connectionString string a valid connection string for an OleDbConnection
commandText string the stored procedure name or T-OleDb command
return void

GetCachedParameterSet() public static method

retrieve a parameter array from the cache
public static GetCachedParameterSet ( string connectionString, string commandText ) : System.Data.OleDb.OleDbParameter[]
connectionString string a valid connection string for a OleDbConnection
commandText string the stored procedure name or T-OleDb command
return System.Data.OleDb.OleDbParameter[]

GetSpParameterSet() public static method

Retrieves the set of OleDbParameters appropriate for the stored procedure
This method will query the database for this information, and then store it in a cache for future requests.
public static GetSpParameterSet ( string connectionString, string spName ) : System.Data.OleDb.OleDbParameter[]
connectionString string a valid connection string for a OleDbConnection
spName string the name of the stored prcedure
return System.Data.OleDb.OleDbParameter[]

GetSpParameterSet() public static method

Retrieves the set of OleDbParameters appropriate for the stored procedure
This method will query the database for this information, and then store it in a cache for future requests.
public static GetSpParameterSet ( string connectionString, string spName, bool includeReturnValueParameter ) : System.Data.OleDb.OleDbParameter[]
connectionString string a valid connection string for an OleDbConnection
spName string the name of the stored procedure
includeReturnValueParameter bool a bool value indicating weather the return value parameter should be included in the results
return System.Data.OleDb.OleDbParameter[]