Enterprise Library Data Access Application Block
7.0-rc1
The Data Access Application Block abstracts the actual database you are using, and exposes a collection of methods that make it easy to access that database and to perform common tasks.
|
Represents an abstract database that commands can be run against. More...
Classes | |
class | OldConnectionWrapper |
This is a helper class that is used to manage the lifetime of a connection for various Execute methods. We needed this class to support implicit transactions created with the TransactionScope class. In this case, the various Execute methods need to use a shared connection instead of a new connection for each request in order to prevent a distributed transaction. More... | |
Public Member Functions | |
void | AddInParameter (DbCommand command, string name, DbType dbType) |
Adds a new In DbParameter object to the given command . More... | |
void | AddInParameter (DbCommand command, string name, DbType dbType, object value) |
Adds a new In DbParameter object to the given command . More... | |
void | AddInParameter (DbCommand command, string name, DbType dbType, string sourceColumn, DataRowVersion sourceVersion) |
Adds a new In DbParameter object to the given command . More... | |
void | AddOutParameter (DbCommand command, string name, DbType dbType, int size) |
Adds a new Out DbParameter object to the given command . More... | |
void | AddInOutParameter (DbCommand command, string name, DbType dbType, object value) |
Adds new In/Out DbParameter object to given command More... | |
void | AddInOutParameter (DbCommand command, string name, DbType dbType, int size, object value) |
Adds new In/Out DbParameter object to given command More... | |
virtual void | AddParameter (DbCommand command, string name, DbType dbType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value) |
Adds a new In DbParameter object to the given command . More... | |
void | AddParameter (DbCommand command, string name, DbType dbType, ParameterDirection direction, string sourceColumn, DataRowVersion sourceVersion, object value) |
Adds a new instance of a DbParameter object to the command. More... | |
virtual string | BuildParameterName (string name) |
Builds a value parameter name for the current database. More... | |
virtual DbConnection | CreateConnection () |
Creates a connection for this database. More... | |
void | DiscoverParameters (DbCommand command) |
Discovers the parameters for a DbCommand. More... | |
virtual DataSet | ExecuteDataSet (DbCommand command) |
Executes the command and returns the results in a new DataSet. More... | |
virtual DataSet | ExecuteDataSet (DbCommand command, DbTransaction transaction) |
Executes the command as part of the transaction and returns the results in a new DataSet. More... | |
virtual DataSet | ExecuteDataSet (string storedProcedureName, params object[] parameterValues) |
Executes the storedProcedureName with parameterValues and returns the results in a new DataSet. More... | |
virtual DataSet | ExecuteDataSet (DbTransaction transaction, string storedProcedureName, params object[] parameterValues) |
Executes the storedProcedureName with parameterValues as part of the transaction and returns the results in a new DataSet within a transaction. More... | |
virtual DataSet | ExecuteDataSet (CommandType commandType, string commandText) |
Executes the commandText interpreted as specified by the commandType and returns the results in a new DataSet. More... | |
virtual DataSet | ExecuteDataSet (DbTransaction transaction, CommandType commandType, string commandText) |
Executes the commandText as part of the given transaction and returns the results in a new DataSet. More... | |
virtual int | ExecuteNonQuery (DbCommand command) |
Executes the command and returns the number of rows affected. More... | |
virtual int | ExecuteNonQuery (DbCommand command, DbTransaction transaction) |
Executes the command within the given transaction , and returns the number of rows affected. More... | |
virtual int | ExecuteNonQuery (string storedProcedureName, params object[] parameterValues) |
Executes the storedProcedureName using the given parameterValues and returns the number of rows affected. More... | |
virtual int | ExecuteNonQuery (DbTransaction transaction, string storedProcedureName, params object[] parameterValues) |
Executes the storedProcedureName using the given parameterValues within a transaction and returns the number of rows affected. More... | |
virtual int | ExecuteNonQuery (CommandType commandType, string commandText) |
Executes the commandText interpreted as specified by the commandType and returns the number of rows affected. More... | |
virtual int | ExecuteNonQuery (DbTransaction transaction, CommandType commandType, string commandText) |
Executes the commandText interpreted as specified by the commandType as part of the given transaction and returns the number of rows affected. More... | |
virtual IDataReader | ExecuteReader (DbCommand command) |
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. More... | |
virtual IDataReader | ExecuteReader (DbCommand command, DbTransaction transaction) |
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. More... | |
IDataReader | ExecuteReader (string storedProcedureName, params object[] parameterValues) |
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. More... | |
IDataReader | ExecuteReader (DbTransaction transaction, string storedProcedureName, params object[] parameterValues) |
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. More... | |
IDataReader | ExecuteReader (CommandType commandType, string commandText) |
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. More... | |
IDataReader | ExecuteReader (DbTransaction transaction, CommandType commandType, string commandText) |
Executes the commandText interpreted as specified by 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. More... | |
virtual object | ExecuteScalar (DbCommand command) |
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. More... | |
virtual object | ExecuteScalar (DbCommand command, DbTransaction transaction) |
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. More... | |
virtual object | ExecuteScalar (string storedProcedureName, params object[] parameterValues) |
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. More... | |
virtual object | ExecuteScalar (DbTransaction transaction, string storedProcedureName, params object[] parameterValues) |
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. More... | |
virtual object | ExecuteScalar (CommandType commandType, string commandText) |
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. More... | |
virtual object | ExecuteScalar (DbTransaction transaction, CommandType commandType, string commandText) |
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. More... | |
DbDataAdapter | GetDataAdapter () |
Gets a DbDataAdapter with Standard update behavior. More... | |
virtual object | GetParameterValue (DbCommand command, string name) |
Gets a parameter value. More... | |
DbCommand | GetSqlStringCommand (string query) |
Creates a DbCommand for a SQL query. More... | |
virtual DbCommand | GetStoredProcCommand (string storedProcedureName) |
Creates a DbCommand for a stored procedure. More... | |
virtual DbCommand | GetStoredProcCommand (string storedProcedureName, params object[] parameterValues) |
Creates a DbCommand for a stored procedure. More... | |
virtual void | AssignParameters (DbCommand command, object[] parameterValues) |
Discovers parameters on the command and assigns the values from parameterValues to the command s Parameters list. More... | |
DbCommand | GetStoredProcCommandWithSourceColumns (string storedProcedureName, params string[] sourceColumns) |
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. More... | |
virtual void | LoadDataSet (DbCommand command, DataSet dataSet, string tableName) |
Executes the command and adds a new DataTable to the existing DataSet. More... | |
virtual void | LoadDataSet (DbCommand command, DataSet dataSet, string tableName, DbTransaction transaction) |
Executes the command within the given transaction and adds a new DataTable to the existing DataSet. More... | |
virtual void | LoadDataSet (DbCommand command, DataSet dataSet, string[] tableNames) |
Loads a DataSet from a DbCommand. More... | |
virtual void | LoadDataSet (DbCommand command, DataSet dataSet, string[] tableNames, DbTransaction transaction) |
Loads a DataSet from a DbCommand in a transaction. More... | |
virtual void | LoadDataSet (string storedProcedureName, DataSet dataSet, string[] tableNames, params object[] parameterValues) |
Loads a DataSet with the results returned from a stored procedure. More... | |
virtual void | LoadDataSet (DbTransaction transaction, string storedProcedureName, DataSet dataSet, string[] tableNames, params object[] parameterValues) |
Loads a DataSet with the results returned from a stored procedure executed in a transaction. More... | |
virtual void | LoadDataSet (CommandType commandType, string commandText, DataSet dataSet, string[] tableNames) |
Loads a DataSet from command text. More... | |
void | LoadDataSet (DbTransaction transaction, CommandType commandType, string commandText, DataSet dataSet, string[] tableNames) |
Loads a DataSet from command text in a transaction. More... | |
virtual void | SetParameterValue (DbCommand command, string parameterName, object value) |
Sets a parameter value. More... | |
int | UpdateDataSet (DataSet dataSet, string tableName, DbCommand insertCommand, DbCommand updateCommand, DbCommand deleteCommand, UpdateBehavior updateBehavior, int? updateBatchSize) |
Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet. More... | |
int | UpdateDataSet (DataSet dataSet, string tableName, DbCommand insertCommand, DbCommand updateCommand, DbCommand deleteCommand, UpdateBehavior updateBehavior) |
Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet. More... | |
int | UpdateDataSet (DataSet dataSet, string tableName, DbCommand insertCommand, DbCommand updateCommand, DbCommand deleteCommand, DbTransaction transaction, int? updateBatchSize) |
Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet within a transaction. More... | |
int | UpdateDataSet (DataSet dataSet, string tableName, DbCommand insertCommand, DbCommand updateCommand, DbCommand deleteCommand, DbTransaction transaction) |
Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet within a transaction. More... | |
virtual IAsyncResult | BeginExecuteNonQuery (DbCommand command, AsyncCallback callback, object state) |
Initiates the asynchronous execution of the DbCommand which will return the number of affected records. More... | |
virtual IAsyncResult | BeginExecuteNonQuery (DbCommand command, DbTransaction transaction, AsyncCallback callback, object state) |
Initiates the asynchronous execution of the DbCommand inside a transaction which will return the number of affected records. More... | |
virtual IAsyncResult | BeginExecuteNonQuery (string storedProcedureName, AsyncCallback callback, object state, params object[] parameterValues) |
Initiates the asynchronous execution of the storedProcedureName using the given parameterValues which will return the number of rows affected. More... | |
virtual IAsyncResult | BeginExecuteNonQuery (DbTransaction transaction, string storedProcedureName, AsyncCallback callback, object state, params object[] parameterValues) |
Initiates the asynchronous execution of the storedProcedureName using the given parameterValues inside a transaction which will return the number of rows affected. More... | |
virtual IAsyncResult | BeginExecuteNonQuery (CommandType commandType, string commandText, AsyncCallback callback, object state) |
Initiates the asynchronous execution of the commandText interpreted as specified by the commandType which will return the number of rows affected. More... | |
virtual IAsyncResult | BeginExecuteNonQuery (DbTransaction transaction, CommandType commandType, string commandText, AsyncCallback callback, object state) |
Initiates the asynchronous execution of the commandText interpreted as specified by the commandType inside a transaction which will return the number of rows affected. More... | |
virtual int | EndExecuteNonQuery (IAsyncResult asyncResult) |
Finishes asynchronous execution of a SQL statement, returning the number of affected records. More... | |
virtual IAsyncResult | BeginExecuteReader (DbCommand command, AsyncCallback callback, object state) |
Initiates the asynchronous execution of a command which will return a IDataReader. More... | |
virtual IAsyncResult | BeginExecuteReader (DbCommand command, DbTransaction transaction, AsyncCallback callback, object state) |
Initiates the asynchronous execution of a command inside a transaction which will return a IDataReader. More... | |
virtual IAsyncResult | BeginExecuteReader (string storedProcedureName, AsyncCallback callback, object state, params object[] parameterValues) |
Initiates the asynchronous execution of storedProcedureName using the given parameterValues which will return a IDataReader. More... | |
virtual IAsyncResult | BeginExecuteReader (DbTransaction transaction, string storedProcedureName, AsyncCallback callback, object state, params object[] parameterValues) |
Initiates the asynchronous execution of storedProcedureName using the given parameterValues inside a transaction which will return a IDataReader. More... | |
virtual IAsyncResult | BeginExecuteReader (CommandType commandType, string commandText, AsyncCallback callback, object state) |
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. More... | |
virtual IAsyncResult | BeginExecuteReader (DbTransaction transaction, CommandType commandType, string commandText, AsyncCallback callback, object state) |
Initiates the asynchronous execution of the commandText interpreted as specified by the commandType inside an transaction which will return a IDataReader. More... | |
virtual IDataReader | EndExecuteReader (IAsyncResult asyncResult) |
Finishes asynchronous execution of a Transact-SQL statement, returning an IDataReader. More... | |
virtual IAsyncResult | BeginExecuteScalar (DbCommand command, AsyncCallback callback, object state) |
Initiates the asynchronous execution of a command which will return a single value. More... | |
virtual IAsyncResult | BeginExecuteScalar (DbCommand command, DbTransaction transaction, AsyncCallback callback, object state) |
Initiates the asynchronous execution of a command inside a transaction which will return a single value. More... | |
virtual IAsyncResult | BeginExecuteScalar (string storedProcedureName, AsyncCallback callback, object state, params object[] parameterValues) |
Initiates the asynchronous execution of storedProcedureName using the given parameterValues which will return a single value. More... | |
virtual IAsyncResult | BeginExecuteScalar (DbTransaction transaction, string storedProcedureName, AsyncCallback callback, object state, params object[] parameterValues) |
Initiates the asynchronous execution of storedProcedureName using the given parameterValues inside a transaction which will return a single value. More... | |
virtual IAsyncResult | BeginExecuteScalar (CommandType commandType, string commandText, AsyncCallback callback, object state) |
Initiates the asynchronous execution of the commandText interpreted as specified by the commandType which will return a single value. More... | |
virtual IAsyncResult | BeginExecuteScalar (DbTransaction transaction, CommandType commandType, string commandText, AsyncCallback callback, object state) |
Initiates the asynchronous execution of the commandText interpreted as specified by the commandType inside an transaction which will return a single value. More... | |
virtual object | EndExecuteScalar (IAsyncResult asyncResult) |
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. More... | |
Static Public Member Functions | |
static void | ClearParameterCache () |
Clears the parameter cache. Since there is only one parameter cache that is shared by all instances of this class, this clears all parameters cached for all databases. More... | |
Protected Member Functions | |
Database (string connectionString, DbProviderFactory dbProviderFactory) | |
Initializes a new instance of the Database class with a connection string and a DbProviderFactory. More... | |
virtual void | ConfigureParameter (DbParameter param, string name, DbType dbType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value) |
Configures a given DbParameter. More... | |
DbParameter | CreateParameter (string name, DbType dbType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value) |
Adds a new instance of a DbParameter object. More... | |
DbParameter | CreateParameter (string name) |
Creates a new instance of a DbParameter object. More... | |
abstract void | DeriveParameters (DbCommand discoveryCommand) |
Retrieves parameter information from the stored procedure specified in the DbCommand and populates the Parameters collection of the specified DbCommand object. More... | |
int | DoExecuteNonQuery (DbCommand command) |
Executes the query for command . More... | |
virtual IDataReader | CreateWrappedReader (DatabaseConnectionWrapper connection, IDataReader innerReader) |
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. More... | |
DbDataAdapter | GetDataAdapter (UpdateBehavior updateBehavior) |
Gets the DbDataAdapter with the given update behavior and connection from the proper derived class. More... | |
DatabaseConnectionWrapper | 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. More... | |
virtual DatabaseConnectionWrapper | GetWrappedConnection () |
Gets a "wrapped" connection for use outside a transaction. More... | |
virtual bool | SameNumberOfParametersAndValues (DbCommand command, object[] values) |
Determines if the number of parameters in the command matches the array of parameter values. More... | |
virtual void | SetUpRowUpdatedEvent (DbDataAdapter adapter) |
Sets the RowUpdated event for the data adapter. More... | |
virtual int | UserParametersStartIndex () |
Returns the starting index for parameters in a command. More... | |
Static Protected Member Functions | |
static void | PrepareCommand (DbCommand command, DbConnection connection) |
Assigns a connection to the command and discovers parameters if needed. More... | |
static void | PrepareCommand (DbCommand command, DbTransaction transaction) |
Assigns a transaction to the command and discovers parameters if needed. More... | |
Properties | |
string | ConnectionString [get] |
Gets the string used to open a database. More... | |
string | ConnectionStringNoCredentials [get] |
Gets the connection string without the username and password. More... | |
string | ConnectionStringWithoutCredentials [get] |
Gets the connection string without credentials. More... | |
DbProviderFactory | DbProviderFactory [get] |
Gets the DbProviderFactory used by the database instance. More... | |
virtual bool | SupportsParemeterDiscovery [get] |
Does this Database object support parameter discovery? More... | |
virtual bool | SupportsAsync [get] |
Does this Database object support asynchronous execution? More... | |
Represents an abstract database that commands can be run against.
The Database class leverages the provider factory model from ADO.NET. A database instance holds a reference to a concrete DbProviderFactory object to which it forwards the creation of ADO.NET objects.
|
protected |
Initializes a new instance of the Database class with a connection string and a DbProviderFactory.
connectionString | The connection string for the database. |
dbProviderFactory | A DbProviderFactory object. |
void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInOutParameter | ( | DbCommand | command, |
string | name, | ||
DbType | dbType, | ||
int | size, | ||
object | value | ||
) |
Adds new In/Out DbParameter object to given command
command | The command to add the in/out parameter. |
name | The name of the parameter |
dbType | One of the DbType values. |
size | The maximum size of the data within the column. |
value | The value of the parameter for In direction. |
void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInOutParameter | ( | DbCommand | command, |
string | name, | ||
DbType | dbType, | ||
object | value | ||
) |
Adds new In/Out DbParameter object to given command
command | The command to add the in/out parameter. |
name | The name of the parameter |
dbType | One of the DbType values. |
value | The value of the parameter for In direction. |
void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInParameter | ( | DbCommand | command, |
string | name, | ||
DbType | dbType | ||
) |
Adds a new In DbParameter object to the given command .
command | The command to add the in parameter. |
name | The name of the parameter. |
dbType | One of the DbType values. |
This version of the method is used when you can have the same parameter object multiple times with different values.
void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInParameter | ( | DbCommand | command, |
string | name, | ||
DbType | dbType, | ||
object | value | ||
) |
Adds a new In DbParameter object to the given command .
command | The command to add the parameter. |
name | The name of the parameter. |
dbType | One of the DbType values. |
value | The value of the parameter. |
void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInParameter | ( | DbCommand | command, |
string | name, | ||
DbType | dbType, | ||
string | sourceColumn, | ||
DataRowVersion | sourceVersion | ||
) |
Adds a new In DbParameter object to the given command .
command | The command to add the parameter. |
name | The name of the parameter. |
dbType | One of the DbType values. |
sourceColumn | The name of the source column mapped to the DataSet and used for loading or returning the value. |
sourceVersion | One of the DataRowVersion values. |
void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddOutParameter | ( | DbCommand | command, |
string | name, | ||
DbType | dbType, | ||
int | size | ||
) |
Adds a new Out DbParameter object to the given command .
command | The command to add the out parameter. |
name | The name of the parameter. |
dbType | One of the DbType values. |
size | The maximum size of the data within the column. |
|
virtual |
Adds a new In DbParameter object to the given command .
command | The command to add the parameter. |
name | The name of the parameter. |
dbType | One of the DbType values. |
size | The maximum size of the data within the column. |
direction | One of the ParameterDirection values. |
nullable | A value indicating whether the parameter accepts null (Nothing in Visual Basic) values. |
precision | The maximum number of digits used to represent the value . |
scale | The number of decimal places to which value is resolved. |
sourceColumn | The name of the source column mapped to the DataSet and used for loading or returning the value . |
sourceVersion | One of the DataRowVersion values. |
value | The value of the parameter. |
ArgumentNullException | command is null. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddParameter | ( | DbCommand | command, |
string | name, | ||
DbType | dbType, | ||
ParameterDirection | direction, | ||
string | sourceColumn, | ||
DataRowVersion | sourceVersion, | ||
object | value | ||
) |
Adds a new instance of a DbParameter object to the command.
command | The command to add the parameter. |
name | The name of the parameter. |
dbType | One of the DbType values. |
direction | One of the ParameterDirection values. |
sourceColumn | The name of the source column mapped to the DataSet and used for loading or returning the value . |
sourceVersion | One of the DataRowVersion values. |
value | The value of the parameter. |
ArgumentNullException | command is null. |
|
virtual |
Discovers parameters on the command and assigns the values from parameterValues to the command s Parameters list.
command | The command the parameter values will be assigned to |
parameterValues | The parameter values that will be assigned to the command. |
InvalidOperationException | The number of parameters in parameterValues does not match the number of parameters in command . |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
|
virtual |
Initiates the asynchronous execution of the commandText interpreted as specified by the commandType which will return the number of rows affected.
commandType | One of the CommandType values. |
commandText | The command text to execute. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of the DbCommand which will return the number of affected records.
command | The DbCommand to execute. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of the DbCommand inside a transaction which will return the number of affected records.
command | The DbCommand to execute. |
transaction | The DbTransaction to execute the command within. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of the commandText interpreted as specified by the commandType inside a transaction which will return the number of rows affected.
commandType | One of the CommandType values. |
commandText | The command text to execute. |
transaction | The DbTransaction to execute the command within. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of the storedProcedureName using the given parameterValues inside a transaction which will return the number of rows affected.
storedProcedureName | The name of the stored procedure to execute. |
transaction | The DbTransaction to execute the command within. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of the storedProcedureName using the given parameterValues which will return the number of rows affected.
storedProcedureName | The name of the stored procedure to execute. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
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.
commandType | One of the CommandType values. |
commandText | The command text to execute. |
callback | AsyncCallback to execute when the async operation completes. |
state | State object passed to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of a command which will return a IDataReader.
command | The DbCommand to execute. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of a command inside a transaction which will return a IDataReader.
command | The DbCommand to execute. |
transaction | The DbTransaction to execute the command within. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of the commandText interpreted as specified by the commandType inside an transaction which will return a IDataReader.
commandType | One of the CommandType values. |
commandText | The command text to execute. |
transaction | The DbTransaction to execute the command within. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of storedProcedureName using the given parameterValues inside a transaction which will return a IDataReader.
transaction | The DbTransaction to execute the command within. |
storedProcedureName | The name of the stored procedure to execute. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of storedProcedureName using the given parameterValues which will return a IDataReader.
storedProcedureName | The name of the stored procedure to execute. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of the commandText interpreted as specified by the commandType which will return a single value.
commandType | One of the CommandType values. |
commandText | The command text to execute. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of a command which will return a single value.
command | The DbCommand to execute. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of a command inside a transaction which will return a single value.
command | The DbCommand to execute. |
transaction | The DbTransaction to execute the command within. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of the commandText interpreted as specified by the commandType inside an transaction which will return a single value.
commandType | One of the CommandType values. |
commandText | The command text to execute. |
transaction | The DbTransaction to execute the command within. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of storedProcedureName using the given parameterValues inside a transaction which will return a single value.
transaction | The DbTransaction to execute the command within. |
storedProcedureName | The name of the stored procedure to execute. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Initiates the asynchronous execution of storedProcedureName using the given parameterValues which will return a single value.
storedProcedureName | The name of the stored procedure to execute. |
callback | The async callback to execute when the result of the operation is available. Pass <langword>null</langword> if you don't want to use a callback. |
state | Additional state object to pass to the callback. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Builds a value parameter name for the current database.
name | The name of the parameter. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
static |
Clears the parameter cache. Since there is only one parameter cache that is shared by all instances of this class, this clears all parameters cached for all databases.
|
protectedvirtual |
Configures a given DbParameter.
param | The DbParameter to configure. |
name | The name of the parameter. |
dbType | One of the DbType values. |
size | The maximum size of the data within the column. |
direction | One of the ParameterDirection values. |
nullable | A value indicating whether the parameter accepts null (Nothing in Visual Basic) values. |
precision | The maximum number of digits used to represent the value . |
scale | The number of decimal places to which value is resolved. |
sourceColumn | The name of the source column mapped to the DataSet and used for loading or returning the value . |
sourceVersion | One of the DataRowVersion values. |
value | The value of the parameter. |
|
virtual |
Creates a connection for this database.
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.
|
protected |
Creates a new instance of a DbParameter object.
name | The name of the parameter. |
|
protected |
Adds a new instance of a DbParameter object.
name | The name of the parameter. |
dbType | One of the DbType values. |
size | The maximum size of the data within the column. |
direction | One of the ParameterDirection values. |
nullable | A value indicating whether the parameter accepts null (Nothing in Visual Basic) values. |
precision | The maximum number of digits used to represent the value . |
scale | The number of decimal places to which value is resolved. |
sourceColumn | The name of the source column mapped to the DataSet and used for loading or returning the value . |
sourceVersion | One of the DataRowVersion values. |
value | The value of the parameter. |
|
protectedvirtual |
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.
connection | Connection + refcount. |
innerReader | The reader to wrap. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
|
protectedpure virtual |
Retrieves parameter information from the stored procedure specified in the DbCommand and populates the Parameters collection of the specified DbCommand object.
discoveryCommand | The DbCommand to do the discovery. |
Implemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase, Microsoft.Practices.EnterpriseLibrary.Data.GenericDatabase, Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase, Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase, Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.Odbc.OdbcDatabase.
void Microsoft.Practices.EnterpriseLibrary.Data.Database.DiscoverParameters | ( | DbCommand | command | ) |
Discovers the parameters for a DbCommand.
command | The DbCommand to discover the parameters. |
You should get the value of SupportsParemeterDiscovery to detect if parameter discovery is supported for your database provider type.
|
protected |
Executes the query for command .
command | The DbCommand representing the query to execute. |
|
virtual |
Finishes asynchronous execution of a SQL statement, returning the number of affected records.
asyncResult | The IAsyncResult returned by a call to any overload of BeginExecuteNonQuery(DbCommand, AsyncCallback, object). |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Finishes asynchronous execution of a Transact-SQL statement, returning an IDataReader.
asyncResult | The IAsyncResult returned by a call to any overload of BeginExecuteReader. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
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.
asyncResult | The IAsyncResult returned by a call to any overload of BeginExecuteScalar. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.
|
virtual |
Executes the commandText interpreted as specified by the commandType and returns the results in a new DataSet.
commandType | One of the CommandType values. |
commandText | The command text to execute. |
|
virtual |
Executes the command and returns the results in a new DataSet.
command | The DbCommand to execute. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
|
virtual |
Executes the command as part of the transaction and returns the results in a new DataSet.
command | The DbCommand to execute. |
transaction | The IDbTransaction to execute the command within. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
|
virtual |
Executes the commandText as part of the given transaction and returns the results in a new DataSet.
transaction | The IDbTransaction to execute the command within. |
commandType | One of the CommandType values. |
commandText | The command text to execute. |
|
virtual |
Executes the storedProcedureName with parameterValues as part of the transaction and returns the results in a new DataSet within a transaction.
transaction | The IDbTransaction to execute the command within. |
storedProcedureName | The stored procedure to execute. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
|
virtual |
Executes the storedProcedureName with parameterValues and returns the results in a new DataSet.
storedProcedureName | The stored procedure to execute. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.
|
virtual |
Executes the commandText interpreted as specified by the commandType and returns the number of rows affected.
commandType | One of the CommandType values. |
commandText | The command text to execute. |
|
virtual |
Executes the command and returns the number of rows affected.
command | The command that contains the query to execute. |
|
virtual |
Executes the command within the given transaction , and returns the number of rows affected.
command | The command that contains the query to execute. |
transaction | The IDbTransaction to execute the command within. |
|
virtual |
Executes the commandText interpreted as specified by the commandType as part of the given transaction and returns the number of rows affected.
transaction | The IDbTransaction to execute the command within. |
commandType | One of the CommandType values. |
commandText | The command text to execute. |
|
virtual |
Executes the storedProcedureName using the given parameterValues within a transaction and returns the number of rows affected.
transaction | The IDbTransaction to execute the command within. |
storedProcedureName | The name of the stored procedure to execute. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
|
virtual |
Executes the storedProcedureName using the given parameterValues and returns the number of rows affected.
storedProcedureName | The name of the stored procedure to execute. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.
IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader | ( | CommandType | commandType, |
string | commandText | ||
) |
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.
commandType | One of the CommandType values. |
commandText | The command text to execute. |
|
virtual |
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.
command | The command that contains the query to execute. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
|
virtual |
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.
command | The command that contains the query to execute. |
transaction | The IDbTransaction to execute the command within. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader | ( | DbTransaction | transaction, |
CommandType | commandType, | ||
string | commandText | ||
) |
Executes the commandText interpreted as specified by 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.
transaction | The IDbTransaction to execute the command within. |
commandType | One of the CommandType values. |
commandText | The command text to execute. |
IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader | ( | DbTransaction | transaction, |
string | storedProcedureName, | ||
params object[] | parameterValues | ||
) |
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.
transaction | The IDbTransaction to execute the command within. |
storedProcedureName | The command that contains the query to execute. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader | ( | string | storedProcedureName, |
params object[] | parameterValues | ||
) |
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.
storedProcedureName | The command that contains the query to execute. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
|
virtual |
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.
commandType | One of the CommandType values. |
commandText | The command text to execute. |
|
virtual |
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.
command | The command that contains the query to execute. |
|
virtual |
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.
command | The command that contains the query to execute. |
transaction | The IDbTransaction to execute the command within. |
|
virtual |
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.
transaction | The IDbTransaction to execute the command within. |
commandType | One of the CommandType values. |
commandText | The command text to execute. |
|
virtual |
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.
transaction | The IDbTransaction to execute the command within. |
storedProcedureName | The stored procedure to execute. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
|
virtual |
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.
storedProcedureName | The stored procedure to execute. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.
DbDataAdapter Microsoft.Practices.EnterpriseLibrary.Data.Database.GetDataAdapter | ( | ) |
Gets a DbDataAdapter with Standard update behavior.
Created this new, public method instead of modifying the protected, abstract one so that there will be no breaking changes for any currently derived Database class.
|
protected |
Gets the DbDataAdapter with the given update behavior and connection from the proper derived class.
updateBehavior | One of the UpdateBehavior values. |
|
protected |
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.
|
virtual |
Gets a parameter value.
command | The command that contains the parameter. |
name | The name of the parameter. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
DbCommand Microsoft.Practices.EnterpriseLibrary.Data.Database.GetSqlStringCommand | ( | string | query | ) |
Creates a DbCommand for a SQL query.
query | The text of the query. |
ArgumentException | query is null or empty. |
|
virtual |
Creates a DbCommand for a stored procedure.
storedProcedureName | The name of the stored procedure. |
ArgumentException | storedProcedureName is null or empty. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
|
virtual |
Creates a DbCommand for a stored procedure.
storedProcedureName | The name of the stored procedure. |
parameterValues | The list of parameters for the procedure. |
The parameters for the stored procedure will be discovered and the values are assigned in positional order.
ArgumentException | storedProcedureName is null or empty. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
DbCommand Microsoft.Practices.EnterpriseLibrary.Data.Database.GetStoredProcCommandWithSourceColumns | ( | string | storedProcedureName, |
params string[] | sourceColumns | ||
) |
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.
storedProcedureName | The name of the stored procedure. |
sourceColumns | The list of DataFields for the procedure. |
|
protectedvirtual |
Gets a "wrapped" connection for use outside a transaction.
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.
|
virtual |
Loads a DataSet from command text.
commandType | One of the CommandType values. |
commandText | The command text to execute. |
dataSet | The DataSet to fill. |
tableNames | An array of table name mappings for the DataSet. |
|
virtual |
Executes the command and adds a new DataTable to the existing DataSet.
command | The DbCommand to execute. |
dataSet | The DataSet to load. |
tableName | The name for the new DataTable to add to the DataSet. |
System.ArgumentNullException | Any input parameter was null (Nothing in Visual Basic) |
System.ArgumentException | tableName was an empty string |
|
virtual |
Executes the command within the given transaction and adds a new DataTable to the existing DataSet.
command | The DbCommand to execute. |
dataSet | The DataSet to load. |
tableName | The name for the new DataTable to add to the DataSet. |
transaction | The IDbTransaction to execute the command within. |
System.ArgumentNullException | Any input parameter was null (Nothing in Visual Basic). |
System.ArgumentException | tableName was an empty string. |
|
virtual |
Loads a DataSet from a DbCommand.
command | The command to execute to fill the DataSet. |
dataSet | The DataSet to fill. |
tableNames | An array of table name mappings for the DataSet. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
|
virtual |
Loads a DataSet from a DbCommand in a transaction.
command | The command to execute to fill the DataSet. |
dataSet | The DataSet to fill. |
tableNames | An array of table name mappings for the DataSet. |
transaction | The IDbTransaction to execute the command in. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
void Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet | ( | DbTransaction | transaction, |
CommandType | commandType, | ||
string | commandText, | ||
DataSet | dataSet, | ||
string[] | tableNames | ||
) |
Loads a DataSet from command text in a transaction.
transaction | The IDbTransaction to execute the command in. |
commandType | One of the CommandType values. |
commandText | The command text to execute. |
dataSet | The DataSet to fill. |
tableNames | An array of table name mappings for the DataSet. |
|
virtual |
Loads a DataSet with the results returned from a stored procedure executed in a transaction.
transaction | The IDbTransaction to execute the stored procedure in. |
storedProcedureName | The stored procedure name to execute. |
dataSet | The DataSet to fill. |
tableNames | An array of table name mappings for the DataSet. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
|
virtual |
Loads a DataSet with the results returned from a stored procedure.
storedProcedureName | The stored procedure name to execute. |
dataSet | The DataSet to fill. |
tableNames | An array of table name mappings for the DataSet. |
parameterValues | An array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.
|
staticprotected |
Assigns a connection to the command and discovers parameters if needed.
command | The command that contains the query to prepare. |
connection | The connection to assign to the command. |
|
staticprotected |
Assigns a transaction to the command and discovers parameters if needed.
command | The command that contains the query to prepare. |
transaction | The transaction to assign to the command. |
|
protectedvirtual |
Determines if the number of parameters in the command matches the array of parameter values.
command | The DbCommand containing the parameters. |
values | The array of parameter values. |
true
if the number of parameters and values match; otherwise, false
.Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase.
|
virtual |
Sets a parameter value.
command | The command with the parameter. |
parameterName | The parameter name. |
value | The parameter value. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.
|
protectedvirtual |
Sets the RowUpdated event for the data adapter.
adapter | The DbDataAdapter to set the event. |
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase, Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase, Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase, Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.Odbc.OdbcDatabase.
int Microsoft.Practices.EnterpriseLibrary.Data.Database.UpdateDataSet | ( | DataSet | dataSet, |
string | tableName, | ||
DbCommand | insertCommand, | ||
DbCommand | updateCommand, | ||
DbCommand | deleteCommand, | ||
DbTransaction | transaction | ||
) |
Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet within a transaction.
dataSet | The DataSet used to update the data source. |
tableName | The name of the source table to use for table mapping. |
insertCommand | The DbCommand executed when DataRowState is DataRowState.Added. |
updateCommand | The DbCommand executed when DataRowState is DataRowState.Modified. |
deleteCommand | The DbCommand executed when DataRowState is DataRowState.Deleted. |
transaction | The IDbTransaction to use. |
int Microsoft.Practices.EnterpriseLibrary.Data.Database.UpdateDataSet | ( | DataSet | dataSet, |
string | tableName, | ||
DbCommand | insertCommand, | ||
DbCommand | updateCommand, | ||
DbCommand | deleteCommand, | ||
DbTransaction | transaction, | ||
int? | updateBatchSize | ||
) |
Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet within a transaction.
dataSet | The DataSet used to update the data source. |
tableName | The name of the source table to use for table mapping. |
insertCommand | The DbCommand executed when DataRowState is DataRowState.Added. |
updateCommand | The DbCommand executed when DataRowState is DataRowState.Modified. |
deleteCommand | The DbCommand executed when DataRowState is DataRowState.Deleted. |
transaction | The IDbTransaction to use. |
updateBatchSize | The number of commands that can be executed in a single call to the database. Set to 0 to use the largest size the server can handle, 1 to disable batch updates, and anything else to set the number of rows. |
int Microsoft.Practices.EnterpriseLibrary.Data.Database.UpdateDataSet | ( | DataSet | dataSet, |
string | tableName, | ||
DbCommand | insertCommand, | ||
DbCommand | updateCommand, | ||
DbCommand | deleteCommand, | ||
UpdateBehavior | updateBehavior | ||
) |
Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet.
dataSet | The DataSet used to update the data source. |
tableName | The name of the source table to use for table mapping. |
insertCommand | The DbCommand executed when DataRowState is DataRowState.Added |
updateCommand | The DbCommand executed when DataRowState is DataRowState.Modified |
deleteCommand | The DbCommand executed when DataRowState is DataRowState.Deleted |
updateBehavior | One of the UpdateBehavior values. |
int Microsoft.Practices.EnterpriseLibrary.Data.Database.UpdateDataSet | ( | DataSet | dataSet, |
string | tableName, | ||
DbCommand | insertCommand, | ||
DbCommand | updateCommand, | ||
DbCommand | deleteCommand, | ||
UpdateBehavior | updateBehavior, | ||
int? | updateBatchSize | ||
) |
Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet.
dataSet | The DataSet used to update the data source. |
tableName | The name of the source table to use for table mapping. |
insertCommand | The DbCommand executed when DataRowState is DataRowState.Added |
updateCommand | The DbCommand executed when DataRowState is DataRowState.Modified |
deleteCommand | The DbCommand executed when DataRowState is DataRowState.Deleted |
updateBehavior | One of the UpdateBehavior values. |
updateBatchSize | The number of database commands to execute in a batch. |
|
protectedvirtual |
Returns the starting index for parameters in a command.
Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase.
|
get |
Gets the string used to open a database.
The string used to open a database.
|
getprotected |
Gets the connection string without the username and password.
The connection string without the username and password.
|
get |
Gets the connection string without credentials.
The connection string without credentials.
|
get |
Gets the DbProviderFactory used by the database instance.
|
get |
Does this Database object support asynchronous execution?
Base class always returns false.
|
get |
Does this Database object support parameter discovery?
Base class always returns false.