C# Class yycms.admin.SqlHelperParameterCache

SqlHelperParameterCache provides functions to leverage a static cache of procedure parameters, and the ability to discover parameters for stored procedures at run-time.
Afficher le fichier Open project: seven1276/yycms

Méthodes publiques

Méthode Description
CacheParameterSet ( string connectionString, string commandText ) : void

Add parameter array to the cache

GetCachedParameterSet ( string connectionString, string commandText ) : System.Data.SqlClient.SqlParameter[]

Retrieve a parameter array from the cache

GetSpParameterSet ( string connectionString, string spName ) : System.Data.SqlClient.SqlParameter[]

Retrieves the set of SqlParameters 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.SqlClient.SqlParameter[]

Retrieves the set of SqlParameters 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

Méthode Description
CloneParameters ( SqlParameter originalParameters ) : System.Data.SqlClient.SqlParameter[]

Deep copy of cached SqlParameter array

DiscoverSpParameterSet ( SqlConnection connection, string spName, bool includeReturnValueParameter ) : System.Data.SqlClient.SqlParameter[]

Resolve at run time the appropriate set of SqlParameters for a stored procedure

GetSpParameterSet ( SqlConnection connection, string spName ) : System.Data.SqlClient.SqlParameter[]

Retrieves the set of SqlParameters 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 ( SqlConnection connection, string spName, bool includeReturnValueParameter ) : System.Data.SqlClient.SqlParameter[]

Retrieves the set of SqlParameters appropriate for the stored procedure

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

GetSpParameterSetInternal ( SqlConnection connection, string spName, bool includeReturnValueParameter ) : System.Data.SqlClient.SqlParameter[]

Retrieves the set of SqlParameters appropriate for the stored procedure

SqlHelperParameterCache ( ) : System

Method Details

CacheParameterSet() public static méthode

Add parameter array to the cache
public static CacheParameterSet ( string connectionString, string commandText ) : void
connectionString string A valid connection string for a SqlConnection
commandText string The stored procedure name or T-SQL command
Résultat void

GetCachedParameterSet() public static méthode

Retrieve a parameter array from the cache
public static GetCachedParameterSet ( string connectionString, string commandText ) : System.Data.SqlClient.SqlParameter[]
connectionString string A valid connection string for a SqlConnection
commandText string The stored procedure name or T-SQL command
Résultat System.Data.SqlClient.SqlParameter[]

GetSpParameterSet() public static méthode

Retrieves the set of SqlParameters 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.SqlClient.SqlParameter[]
connectionString string A valid connection string for a SqlConnection
spName string The name of the stored procedure
Résultat System.Data.SqlClient.SqlParameter[]

GetSpParameterSet() public static méthode

Retrieves the set of SqlParameters 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.SqlClient.SqlParameter[]
connectionString string A valid connection string for a SqlConnection
spName string The name of the stored procedure
includeReturnValueParameter bool A bool value indicating whether the return value parameter should be included in the results
Résultat System.Data.SqlClient.SqlParameter[]