C# Class Rock.Data.DbService

Helper class to provide native SQL methods
Datei anzeigen Open project: SparkDevNetwork/Rock

Public Methods

Method 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

Method Description
GetConnectionString ( ) : string

Method Details

ExecuteCommand() public static method

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)
return int

ExecuteScaler() public static method

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.
return object

GetDataReader() public static method

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.
return IDataReader

GetDataSet() public static method

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.
return System.Data.DataSet

GetDataTable() public static method

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.
return DataTable