C# Class Rock.Data.DbService

Helper class to provide native SQL methods
Afficher le fichier Open project: SparkDevNetwork/Rock

Méthodes publiques

Méthode Description
ExecuteCommand ( string query, CommandType commandType = CommandType.Text, object>.Dictionary parameters = null, int commandTimeout = null ) : int

Executes the query, and returns number of rows affected

ExecuteScaler ( string query, CommandType commandType = CommandType.Text, object>.Dictionary parameters = null ) : object

Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

GetDataReader ( string query, CommandType commandType, object>.Dictionary parameters ) : IDataReader

Gets a data reader.

GetDataSet ( string query, CommandType commandType, object>.Dictionary parameters, int timeOut = null ) : DataSet

Gets a data set.

GetDataTable ( string query, CommandType commandType, object>.Dictionary parameters ) : DataTable

Gets a data table.

Private Methods

Méthode Description
GetConnectionString ( ) : string

Method Details

ExecuteCommand() public static méthode

Executes the query, and returns number of rows affected
public static ExecuteCommand ( string query, CommandType commandType = CommandType.Text, object>.Dictionary parameters = null, int commandTimeout = null ) : int
query string The query.
commandType CommandType Type of the command.
parameters object>.Dictionary The parameters.
commandTimeout int The command timeout (seconds)
Résultat int

ExecuteScaler() public static méthode

Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
public static ExecuteScaler ( string query, CommandType commandType = CommandType.Text, object>.Dictionary parameters = null ) : object
query string The query.
commandType CommandType Type of the command.
parameters object>.Dictionary The parameters.
Résultat object

GetDataReader() public static méthode

Gets a data reader.
public static GetDataReader ( string query, CommandType commandType, object>.Dictionary parameters ) : IDataReader
query string The query.
commandType CommandType Type of the command.
parameters object>.Dictionary The parameters.
Résultat IDataReader

GetDataSet() public static méthode

Gets a data set.
public static GetDataSet ( string query, CommandType commandType, object>.Dictionary parameters, int timeOut = null ) : DataSet
query string The query.
commandType CommandType Type of the command.
parameters object>.Dictionary The parameters.
timeOut int The time out in seconds.
Résultat System.Data.DataSet

GetDataTable() public static méthode

Gets a data table.
public static GetDataTable ( string query, CommandType commandType, object>.Dictionary parameters ) : DataTable
query string The query.
commandType CommandType Type of the command.
parameters object>.Dictionary The parameters.
Résultat DataTable