SqlDatabase Members
Include Protected Members
Include Inherited Members
The SqlDatabase type exposes the following members.
Constructors
Name | Description | |
---|---|---|
SqlDatabase |
Initializes a new instance of the SqlDatabase class with a connection string.
|
Methods
Name | Description | |
---|---|---|
AddInParameter(DbCommand, String, DbType) |
Adds a new In DbParameter object to the given command.
(Inherited from Database.) |
|
AddInParameter(DbCommand, String, SqlDbType) |
Adds a new In DbParameter object to the given command.
|
|
AddInParameter(DbCommand, String, DbType, Object) |
Adds a new In DbParameter object to the given command.
(Inherited from Database.) |
|
AddInParameter(DbCommand, String, SqlDbType, Object) |
Adds a new In DbParameter object to the given command.
|
|
AddInParameter(DbCommand, String, DbType, String, DataRowVersion) |
Adds a new In DbParameter object to the given command.
(Inherited from Database.) |
|
AddInParameter(DbCommand, String, SqlDbType, String, DataRowVersion) |
Adds a new In DbParameter object to the given command.
|
|
AddOutParameter(DbCommand, String, DbType, Int32) |
Adds a new Out DbParameter object to the given command.
(Inherited from Database.) |
|
AddOutParameter(DbCommand, String, SqlDbType, Int32) |
Adds a new Out DbParameter object to the given command.
|
|
AddParameter(DbCommand, String, DbType, ParameterDirection, String, DataRowVersion, Object) | Adds a new instance of a DbParameter object to the command. |
|
AddParameter(DbCommand, String, SqlDbType, ParameterDirection, String, DataRowVersion, Object) | Adds a new instance of a DbParameter object to the command. |
|
AddParameter(DbCommand, String, DbType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) |
Adds a new In DbParameter object to the given command.
(Inherited from Database.) |
|
AddParameter(DbCommand, String, SqlDbType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) | Adds a new instance of a DbParameter object to the command. |
|
AssignParameters | Discovers parameters on the command and assigns the values from parameterValues to the commands Parameters list. |
|
BeginExecuteNonQuery(DbCommand, AsyncCallback, Object) | Initiates the asynchronous execution of the SqlCommand which will return the number of affected records. |
|
BeginExecuteNonQuery(CommandType, String, AsyncCallback, Object) | Initiates the asynchronous execution of the commandText interpreted as specified by the commandType which will return the number of rows affected. |
|
BeginExecuteNonQuery(DbCommand, DbTransaction, AsyncCallback, Object) | Initiates the asynchronous execution of the DbCommand inside a transaction which will return the number of affected records. |
|
BeginExecuteNonQuery(String, AsyncCallback, Object, array<Object[]) | Initiates the asynchronous execution of the storedProcedureName using the given parameterValues which will return the number of rows affected. |
|
BeginExecuteNonQuery(DbTransaction, CommandType, String, AsyncCallback, Object) | Initiates the asynchronous execution of the the commandText interpreted as specified by the commandType inside a tranasaction which will return the number of rows affected. |
|
BeginExecuteNonQuery(DbTransaction, String, AsyncCallback, Object, array<Object[]) | Initiates the asynchronous execution of the storedProcedureName using the given parameterValues inside a transaction which will return the number of rows affected. |
|
BeginExecuteReader(DbCommand, AsyncCallback, Object) | Initiates the asynchronous execution of a command which will return a IDataReader. |
|
BeginExecuteReader(CommandType, String, AsyncCallback, Object) | Initiates the asynchronous execution of the commandText interpreted as specified by the commandType which will return a IDataReader. When the async operation completes, the callback will be invoked on another thread to process the result. |
|
BeginExecuteReader(DbCommand, DbTransaction, AsyncCallback, Object) | Initiates the asynchronous execution of a command inside a transaction which will return a IDataReader. |
|
BeginExecuteReader(String, AsyncCallback, Object, array<Object[]) | Initiates the asynchronous execution of storedProcedureName using the given parameterValues which will return a IDataReader. |
|
BeginExecuteReader(DbTransaction, CommandType, String, AsyncCallback, Object) | Initiates the asynchronous execution of the commandText interpreted as specified by the commandType inside an transaction which will return a IDataReader. |
|
BeginExecuteReader(DbTransaction, String, AsyncCallback, Object, array<Object[]) | Initiates the asynchronous execution of storedProcedureName using the given parameterValues inside a transaction which will return a IDataReader. |
|
BeginExecuteScalar(DbCommand, AsyncCallback, Object) | Initiates the asynchronous execution of a command which will return a single value. |
|
BeginExecuteScalar(CommandType, String, AsyncCallback, Object) | Initiates the asynchronous execution of the commandText interpreted as specified by the commandType which will return a single value. |
|
BeginExecuteScalar(DbCommand, DbTransaction, AsyncCallback, Object) | Initiates the asynchronous execution of a command inside a transaction which will return a single value. |
|
BeginExecuteScalar(String, AsyncCallback, Object, array<Object[]) | Initiates the asynchronous execution of storedProcedureName using the given parameterValues which will return a single value. |
|
BeginExecuteScalar(DbTransaction, CommandType, String, AsyncCallback, Object) | Initiates the asynchronous execution of the commandText interpreted as specified by the commandType inside an transaction which will return a single value. |
|
BeginExecuteScalar(DbTransaction, String, AsyncCallback, Object, array<Object[]) | Initiates the asynchronous execution of storedProcedureName using the given parameterValues inside a transaction which will return a single value. |
|
BeginExecuteXmlReader(DbCommand, AsyncCallback, Object) | Initiates the asynchronous execution of the SqlCommand which will result in a XmlReader. |
|
BeginExecuteXmlReader(DbCommand, DbTransaction, AsyncCallback, Object) | Initiates the asynchronous execution of the SqlCommand inside a transaction which will result in a XmlReader. |
|
BuildParameterName |
Builds a value parameter name for the current database.
(Overrides Database.BuildParameterName(String).) |
|
ConfigureParameter(DbParameter, String, DbType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) |
Configures a given DbParameter.
(Inherited from Database.) |
|
ConfigureParameter(SqlParameter, String, SqlDbType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) |
Configures a given DbParameter.
|
|
CreateConnection | Creates a connection for this database. |
|
CreateParameter(String) | Adds a new instance of a DbParameter object. |
|
CreateParameter(String, DbType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) | Adds a new instance of a DbParameter object. |
|
CreateParameter(String, SqlDbType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) | Adds a new instance of a DbParameter object. |
|
CreateWrappedReader |
All data readers get wrapped in objects so that they properly manage connections. Some derived Database classes will need to create a different wrapper, so this method is provided so that they can do this.
(Inherited from Database.) |
|
DeriveParameters |
Retrieves parameter information from the stored procedure specified in the DbCommand and populates the Parameters collection of the specified DbCommand object.
(Overrides Database.DeriveParameters(DbCommand).) |
|
DiscoverParameters |
Discovers the parameters for a DbCommand.
(Inherited from Database.) |
|
DoExecuteNonQuery |
Executes the query for command.
(Inherited from Database.) |
|
EndExecuteNonQuery |
Finishes asynchronous execution of a Transact-SQL statement, returning the number of affected records.
(Overrides Database.EndExecuteNonQuery(IAsyncResult).) |
|
EndExecuteReader |
Finishes asynchronous execution of a Transact-SQL statement, returning an IDataReader.
(Overrides Database.EndExecuteReader(IAsyncResult).) |
|
EndExecuteScalar | Finishes asynchronous execution of a Transact-SQL statement, returning the first column of the first row in the result set returned by the query. Extra columns or rows are ignored. |
|
EndExecuteXmlReader |
Finishes asynchronous execution of a Transact-SQL statement, returning the requested data as XML.
|
|
Equals | (Inherited from Object.) | |
ExecuteDataSet(DbCommand) | Executes the command and returns the results in a new DataSet. |
|
ExecuteDataSet(CommandType, String) | Executes the commandText interpreted as specified by the commandType and returns the results in a new DataSet. |
|
ExecuteDataSet(DbCommand, DbTransaction) | Executes the command as part of the transaction and returns the results in a new DataSet. |
|
ExecuteDataSet(String, array<Object[]) | Executes the storedProcedureName with parameterValues and returns the results in a new DataSet. |
|
ExecuteDataSet(DbTransaction, CommandType, String) | Executes the commandText as part of the given transaction and returns the results in a new DataSet. |
|
ExecuteDataSet(DbTransaction, String, array<Object[]) | Executes the storedProcedureName with parameterValues as part of the transaction and returns the results in a new DataSet within a transaction. |
|
ExecuteNonQuery(DbCommand) | Executes the command and returns the number of rows affected. |
|
ExecuteNonQuery(CommandType, String) | Executes the commandText interpreted as specified by the commandType and returns the number of rows affected. |
|
ExecuteNonQuery(DbCommand, DbTransaction) | Executes the command within the given transaction, and returns the number of rows affected. |
|
ExecuteNonQuery(String, array<Object[]) | Executes the storedProcedureName using the given parameterValues and returns the number of rows affected. |
|
ExecuteNonQuery(DbTransaction, CommandType, String) | Executes the commandText interpreted as specified by the commandType as part of the given transaction and returns the number of rows affected. |
|
ExecuteNonQuery(DbTransaction, String, array<Object[]) | Executes the storedProcedureName using the given parameterValues within a transaction and returns the number of rows affected. |
|
ExecuteReader(DbCommand) | Executes the command and returns an IDataReader through which the result can be read. It is the responsibility of the caller to close the reader when finished. |
|
ExecuteReader(CommandType, String) | Executes the commandText interpreted as specified by the commandType and returns an IDataReader through which the result can be read. It is the responsibility of the caller to close the connection and reader when finished. |
|
ExecuteReader(DbCommand, DbTransaction) | Executes the command within a transaction and returns an IDataReader through which the result can be read. It is the responsibility of the caller to close the connection and reader when finished. |
|
ExecuteReader(String, array<Object[]) | Executes the storedProcedureName with the given parameterValues and returns an IDataReader through which the result can be read. It is the responsibility of the caller to close the connection and reader when finished. |
|
ExecuteReader(DbTransaction, CommandType, String) | Executes the commandText interpreted as specified by the commandType within the given transaction and returns an IDataReader through which the result can be read. It is the responsibility of the caller to close the connection and reader when finished. |
|
ExecuteReader(DbTransaction, String, array<Object[]) | Executes the storedProcedureName with the given parameterValues within the given transaction and returns an IDataReader through which the result can be read. It is the responsibility of the caller to close the connection and reader when finished. |
|
ExecuteScalar(DbCommand) | Executes the command and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored. |
|
ExecuteScalar(CommandType, String) | Executes the commandText interpreted as specified by the commandType and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored. |
|
ExecuteScalar(DbCommand, DbTransaction) | Executes the command within a transaction, and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored. |
|
ExecuteScalar(String, array<Object[]) | Executes the storedProcedureName with the given parameterValues and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored. |
|
ExecuteScalar(DbTransaction, CommandType, String) | Executes the commandText interpreted as specified by the commandType within the given transaction and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored. |
|
ExecuteScalar(DbTransaction, String, array<Object[]) | Executes the storedProcedureName with the given parameterValues within a transaction and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored. |
|
ExecuteXmlReader(DbCommand) | Executes the SqlCommand and returns a new XmlReader. |
|
ExecuteXmlReader(DbCommand, DbTransaction) | Executes the SqlCommand in a transaction and returns a new XmlReader. |
|
Finalize |
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.) |
|
GetDataAdapter() |
Gets a DbDataAdapter with Standard update behavior.
(Inherited from Database.) |
|
GetDataAdapter(UpdateBehavior) |
Gets the DbDataAdapter with the given update behavior and connection from the proper derived class.
(Inherited from Database.) |
|
GetHashCode |
Serves as a hash function for a particular type.
(Inherited from Object.) |
|
GetOpenConnection |
Gets a "wrapped" connection that will be not be disposed if a transaction is active (created by creating a TransactionScope instance). The connection will be disposed when no transaction is active.
(Inherited from Database.) |
|
GetParameterValue |
Gets a parameter value.
(Inherited from Database.) |
|
GetSqlStringCommand | Creates a DbCommand for a SQL query. |
|
GetStoredProcCommand(String) | Creates a DbCommand for a stored procedure. |
|
GetStoredProcCommand(String, array<Object[]) | Creates a DbCommand for a stored procedure. |
|
GetStoredProcCommandWithSourceColumns |
Wraps around a derived class's implementation of the GetStoredProcCommandWrapper method and adds functionality for using this method with UpdateDataSet. The GetStoredProcCommandWrapper method (above) that takes a params array expects the array to be filled with VALUES for the parameters. This method differs from the GetStoredProcCommandWrapper method in that it allows a user to pass in a string array. It will also dynamically discover the parameters for the stored procedure and set the parameter's SourceColumns to the strings that are passed in. It does this by mapping the parameters to the strings IN ORDER. Thus, order is very important.
(Inherited from Database.) |
|
GetType |
Gets the Type of the current instance.
(Inherited from Object.) |
|
GetWrappedConnection |
Gets a "wrapped" connection for use outside a transaction.
(Inherited from Database.) |
|
LoadDataSet(DbCommand, DataSet, String) | (Inherited from Database.) | |
LoadDataSet(DbCommand, DataSet, array<String>) | (Inherited from Database.) | |
LoadDataSet(CommandType, String, DataSet, array<String>) | Loads a DataSet from command text. |
|
LoadDataSet(DbCommand, DataSet, String, DbTransaction) | (Inherited from Database.) | |
LoadDataSet(DbCommand, DataSet, array<String>, DbTransaction) | (Inherited from Database.) | |
LoadDataSet(String, DataSet, array<String>, array<Object[]) | Loads a DataSet with the results returned from a stored procedure. |
|
LoadDataSet(DbTransaction, CommandType, String, DataSet, array<String>) | Loads a DataSet from command text in a transaction. |
|
LoadDataSet(DbTransaction, String, DataSet, array<String>, array<Object[]) | Loads a DataSet with the results returned from a stored procedure executed in a transaction. |
|
MemberwiseClone |
Creates a shallow copy of the current Object.
(Inherited from Object.) |
|
SameNumberOfParametersAndValues |
Determines if the number of parameters in the command matches the array of parameter values.
(Overrides Database.SameNumberOfParametersAndValues(DbCommand, array<Object[]).) |
|
SetParameterValue |
Sets a parameter value.
(Inherited from Database.) |
|
SetUpRowUpdatedEvent |
Sets the RowUpdated event for the data adapter.
(Overrides Database.SetUpRowUpdatedEvent(DbDataAdapter).) |
|
ToString |
Returns a string that represents the current object.
(Inherited from Object.) |
|
UpdateDataSet(DataSet, String, DbCommand, DbCommand, DbCommand, UpdateBehavior) | Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet. |
|
UpdateDataSet(DataSet, String, DbCommand, DbCommand, DbCommand, DbTransaction) | Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet within a transaction. |
|
UpdateDataSet(DataSet, String, DbCommand, DbCommand, DbCommand, UpdateBehavior, Nullable<Int32>) | Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet. |
|
UpdateDataSet(DataSet, String, DbCommand, DbCommand, DbCommand, DbTransaction, Nullable<Int32>) | Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet within a transaction. |
|
UserParametersStartIndex |
Returns the starting index for parameters in a command.
(Overrides Database.UserParametersStartIndex().) |
Extension Methods
Name | Description | |
---|---|---|
CreateSprocAccessor<TResult>(String) | Overloaded.
Creates a SprocAccessor<TResult> for the given stored procedure. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.
(Defined by DatabaseExtensions.) |
|
CreateSprocAccessor<TResult>(String, IParameterMapper) | Overloaded.
Creates a SprocAccessor<TResult> for the given stored procedure. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.
(Defined by DatabaseExtensions.) |
|
CreateSprocAccessor<TResult>(String, IRowMapper<TResult>) | Overloaded.
Creates a SprocAccessor<TResult> for the given stored procedure.
(Defined by DatabaseExtensions.) |
|
CreateSprocAccessor<TResult>(String, IResultSetMapper<TResult>) | Overloaded.
Creates a SprocAccessor<TResult> for the given stored procedure.
(Defined by DatabaseExtensions.) |
|
CreateSprocAccessor<TResult>(String, IParameterMapper, IRowMapper<TResult>) | Overloaded.
Creates a SprocAccessor<TResult> for the given stored procedure.
(Defined by DatabaseExtensions.) |
|
CreateSprocAccessor<TResult>(String, IParameterMapper, IResultSetMapper<TResult>) | Overloaded.
Creates a SprocAccessor<TResult> for the given stored procedure.
(Defined by DatabaseExtensions.) |
|
CreateSqlStringAccessor<TResult>(String) | Overloaded.
Creates a SqlStringAccessor<TResult> for the given Transact-SQL query. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.
(Defined by DatabaseExtensions.) |
|
CreateSqlStringAccessor<TResult>(String, IParameterMapper) | Overloaded.
Creates a SqlStringAccessor<TResult> for the given Transact-SQL query. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.
(Defined by DatabaseExtensions.) |
|
CreateSqlStringAccessor<TResult>(String, IRowMapper<TResult>) | Overloaded.
Creates a SqlStringAccessor<TResult> for the given Transact-SQL query.
(Defined by DatabaseExtensions.) |
|
CreateSqlStringAccessor<TResult>(String, IResultSetMapper<TResult>) | Overloaded.
Creates a SqlStringAccessor<TResult> for the given Transact-SQL query.
(Defined by DatabaseExtensions.) |
|
CreateSqlStringAccessor<TResult>(String, IParameterMapper, IRowMapper<TResult>) | Overloaded.
Creates a SqlStringAccessor<TResult> for the given Transact-SQL query.
(Defined by DatabaseExtensions.) |
|
CreateSqlStringAccessor<TResult>(String, IParameterMapper, IResultSetMapper<TResult>) | Overloaded.
Creates a SqlStringAccessor<TResult> for the given Transact-SQL query.
(Defined by DatabaseExtensions.) |
|
ExecuteSprocAccessor<TResult>(String, array<Object[]) | Overloaded.
Executes a stored procedure and returns the result as an enumerable of TResult. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.
(Defined by DatabaseExtensions.) |
|
ExecuteSprocAccessor<TResult>(String, IParameterMapper, array<Object[]) | Overloaded.
Executes a stored procedure and returns the result as an enumerable of TResult. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.
(Defined by DatabaseExtensions.) |
|
ExecuteSprocAccessor<TResult>(String, IRowMapper<TResult>, array<Object[]) | Overloaded.
Executes a stored procedure and returns the result as an enumerable of TResult.
(Defined by DatabaseExtensions.) |
|
ExecuteSprocAccessor<TResult>(String, IResultSetMapper<TResult>, array<Object[]) | Overloaded.
Executes a stored procedure and returns the result as an enumerable of TResult.
(Defined by DatabaseExtensions.) |
|
ExecuteSprocAccessor<TResult>(String, IParameterMapper, IRowMapper<TResult>, array<Object[]) | Overloaded.
Executes a stored procedure and returns the result as an enumerable of TResult.
(Defined by DatabaseExtensions.) |
|
ExecuteSprocAccessor<TResult>(String, IParameterMapper, IResultSetMapper<TResult>, array<Object[]) | Overloaded.
Executes a stored procedure and returns the result as an enumerable of TResult.
(Defined by DatabaseExtensions.) |
|
ExecuteSqlStringAccessor<TResult>(String) | Overloaded.
Executes a Transact-SQL query and returns the result as an enumerable of TResult. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.
(Defined by DatabaseExtensions.) |
|
ExecuteSqlStringAccessor<TResult>(String, IResultSetMapper<TResult>) | Overloaded.
Executes a Transact-SQL query and returns the result as an enumerable of TResult. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.
(Defined by DatabaseExtensions.) |
|
ExecuteSqlStringAccessor<TResult>(String, IRowMapper<TResult>) | Overloaded.
Executes a Transact-SQL query and returns the result as an enumerable of TResult. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.
(Defined by DatabaseExtensions.) |
Properties
Name | Description | |
---|---|---|
ConnectionString | Gets the string used to open a database. |
|
ConnectionStringNoCredentials | Gets the connection string without the username and password. |
|
ConnectionStringWithoutCredentials |
Gets the connection string without credentials.
(Inherited from Database.) |
|
DbProviderFactory | Gets the DbProviderFactory used by the database instance. |
|
ParameterToken | Gets the parameter token used to delimit parameters for the SQL Server database. |
|
SupportsAsync |
Does this Database object support asynchronous execution?
(Overrides Database.SupportsAsync.) |
|
SupportsParemeterDiscovery |
Does this Database object support parameter discovery?
(Overrides Database.SupportsParemeterDiscovery.) |