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.
Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase Class Reference
Inheritance diagram for Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase:
Microsoft.Practices.EnterpriseLibrary.Data.Database

Public Member Functions

 OleDbDatabase (string connectionString)
 Initializes a new instance of the OleDbDatabase. More...
 
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

override 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...
 
override bool SameNumberOfParametersAndValues (DbCommand command, object[] values)
 Determines if the number of parameters in the command matches the array of parameter values. More...
 
override void SetUpRowUpdatedEvent (DbDataAdapter adapter)
 Sets the RowUpdated event for the data adapter.
 
override int UserParametersStartIndex ()
 Returns the starting index for parameters in a command. 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...
 
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...
 

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

override bool SupportsParemeterDiscovery [get]
 Determines whether the database provider supports parameter discovery. This depends on the underlying OLE DB provider. More...
 
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 SupportsAsync [get]
 Does this Database object support asynchronous execution? More...
 

Constructor & Destructor Documentation

◆ OleDbDatabase()

Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase.OleDbDatabase ( string  connectionString)

Initializes a new instance of the OleDbDatabase.

Parameters
connectionStringThe connection string.

Member Function Documentation

◆ AddInOutParameter() [1/2]

void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInOutParameter ( DbCommand  command,
string  name,
DbType  dbType,
int  size,
object  value 
)
inherited

Adds new In/Out DbParameter object to given command

Parameters
commandThe command to add the in/out parameter.
nameThe name of the parameter
dbTypeOne of the DbType values.
sizeThe maximum size of the data within the column.
valueThe value of the parameter for In direction.

◆ AddInOutParameter() [2/2]

void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInOutParameter ( DbCommand  command,
string  name,
DbType  dbType,
object  value 
)
inherited

Adds new In/Out DbParameter object to given command

Parameters
commandThe command to add the in/out parameter.
nameThe name of the parameter
dbTypeOne of the DbType values.
valueThe value of the parameter for In direction.

◆ AddInParameter() [1/3]

void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInParameter ( DbCommand  command,
string  name,
DbType  dbType 
)
inherited

Adds a new In DbParameter object to the given command .

Parameters
commandThe command to add the in parameter.
nameThe name of the parameter.
dbTypeOne of the DbType values.

This version of the method is used when you can have the same parameter object multiple times with different values.

◆ AddInParameter() [2/3]

void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInParameter ( DbCommand  command,
string  name,
DbType  dbType,
object  value 
)
inherited

Adds a new In DbParameter object to the given command .

Parameters
commandThe command to add the parameter.
nameThe name of the parameter.
dbTypeOne of the DbType values.
valueThe value of the parameter.

◆ AddInParameter() [3/3]

void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInParameter ( DbCommand  command,
string  name,
DbType  dbType,
string  sourceColumn,
DataRowVersion  sourceVersion 
)
inherited

Adds a new In DbParameter object to the given command .

Parameters
commandThe command to add the parameter.
nameThe name of the parameter.
dbTypeOne of the DbType values.
sourceColumnThe name of the source column mapped to the DataSet and used for loading or returning the value.
sourceVersionOne of the DataRowVersion values.

◆ AddOutParameter()

void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddOutParameter ( DbCommand  command,
string  name,
DbType  dbType,
int  size 
)
inherited

Adds a new Out DbParameter object to the given command .

Parameters
commandThe command to add the out parameter.
nameThe name of the parameter.
dbTypeOne of the DbType values.
sizeThe maximum size of the data within the column.

◆ AddParameter() [1/2]

virtual void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddParameter ( DbCommand  command,
string  name,
DbType  dbType,
int  size,
ParameterDirection  direction,
bool  nullable,
byte  precision,
byte  scale,
string  sourceColumn,
DataRowVersion  sourceVersion,
object  value 
)
virtualinherited

Adds a new In DbParameter object to the given command .

Parameters
commandThe command to add the parameter.
nameThe name of the parameter.
dbTypeOne of the DbType values.
sizeThe maximum size of the data within the column.
directionOne of the ParameterDirection values.
nullableA value indicating whether the parameter accepts null (Nothing in Visual Basic) values.
precisionThe maximum number of digits used to represent the value .
scaleThe number of decimal places to which value is resolved.
sourceColumnThe name of the source column mapped to the DataSet and used for loading or returning the value .
sourceVersionOne of the DataRowVersion values.
valueThe value of the parameter.
Exceptions
ArgumentNullExceptioncommand is null.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ AddParameter() [2/2]

void Microsoft.Practices.EnterpriseLibrary.Data.Database.AddParameter ( DbCommand  command,
string  name,
DbType  dbType,
ParameterDirection  direction,
string  sourceColumn,
DataRowVersion  sourceVersion,
object  value 
)
inherited

Adds a new instance of a DbParameter object to the command.

Parameters
commandThe command to add the parameter.
nameThe name of the parameter.
dbTypeOne of the DbType values.
directionOne of the ParameterDirection values.
sourceColumnThe name of the source column mapped to the DataSet and used for loading or returning the value .
sourceVersionOne of the DataRowVersion values.
valueThe value of the parameter.
Exceptions
ArgumentNullExceptioncommand is null.

◆ AssignParameters()

virtual void Microsoft.Practices.EnterpriseLibrary.Data.Database.AssignParameters ( DbCommand  command,
object[]  parameterValues 
)
virtualinherited

Discovers parameters on the command and assigns the values from parameterValues to the command s Parameters list.

Parameters
commandThe command the parameter values will be assigned to
parameterValuesThe parameter values that will be assigned to the command.
Exceptions
InvalidOperationExceptionThe number of parameters in parameterValues does not match the number of parameters in command .

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ BeginExecuteNonQuery() [1/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteNonQuery ( CommandType  commandType,
string  commandText,
AsyncCallback  callback,
object  state 
)
virtualinherited

Initiates the asynchronous execution of the commandText interpreted as specified by the commandType which will return the number of rows affected.

Parameters
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
callbackThe 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.
stateAdditional state object to pass to the callback.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteNonQuery, which returns the number of affected records.
See also
Database.ExecuteNonQuery(CommandType,string), EndExecuteNonQuery(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteNonQuery() [2/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteNonQuery ( DbCommand  command,
AsyncCallback  callback,
object  state 
)
virtualinherited

Initiates the asynchronous execution of the DbCommand which will return the number of affected records.

Parameters
commandThe DbCommand to execute.
callbackThe 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.
stateAdditional state object to pass to the callback.
See also
Database.ExecuteNonQuery(DbCommand), EndExecuteNonQuery(IAsyncResult)
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteNonQuery, which returns the number of affected records.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteNonQuery() [3/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteNonQuery ( DbCommand  command,
DbTransaction  transaction,
AsyncCallback  callback,
object  state 
)
virtualinherited

Initiates the asynchronous execution of the DbCommand inside a transaction which will return the number of affected records.

Parameters
commandThe DbCommand to execute.
transactionThe DbTransaction to execute the command within.
callbackThe 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.
stateAdditional state object to pass to the callback.
See also
Database.ExecuteNonQuery(DbCommand), EndExecuteNonQuery(IAsyncResult)
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteNonQuery, which returns the number of affected records.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteNonQuery() [4/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteNonQuery ( DbTransaction  transaction,
CommandType  commandType,
string  commandText,
AsyncCallback  callback,
object  state 
)
virtualinherited

Initiates the asynchronous execution of the commandText interpreted as specified by the commandType inside a transaction which will return the number of rows affected.

Parameters
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
transactionThe DbTransaction to execute the command within.
callbackThe 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.
stateAdditional state object to pass to the callback.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteNonQuery, which returns the number of affected records.
See also
Database.ExecuteNonQuery(CommandType,string), EndExecuteNonQuery(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteNonQuery() [5/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteNonQuery ( DbTransaction  transaction,
string  storedProcedureName,
AsyncCallback  callback,
object  state,
params object[]  parameterValues 
)
virtualinherited

Initiates the asynchronous execution of the storedProcedureName using the given parameterValues inside a transaction which will return the number of rows affected.

Parameters
storedProcedureNameThe name of the stored procedure to execute.
transactionThe DbTransaction to execute the command within.
callbackThe 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.
stateAdditional state object to pass to the callback.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteNonQuery, which returns the number of affected records.
See also
Database.ExecuteNonQuery(string,object[]), EndExecuteNonQuery(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteNonQuery() [6/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteNonQuery ( string  storedProcedureName,
AsyncCallback  callback,
object  state,
params object[]  parameterValues 
)
virtualinherited

Initiates the asynchronous execution of the storedProcedureName using the given parameterValues which will return the number of rows affected.

Parameters
storedProcedureNameThe name of the stored procedure to execute.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
callbackThe 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.
stateAdditional state object to pass to the callback.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteNonQuery, which returns the number of affected records.
See also
Database.ExecuteNonQuery(string,object[]), EndExecuteNonQuery(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteReader() [1/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteReader ( CommandType  commandType,
string  commandText,
AsyncCallback  callback,
object  state 
)
virtualinherited

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.

Parameters
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
callbackAsyncCallback to execute when the async operation completes.
stateState object passed to the callback.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteReader, which returns the IDataReader.
See also
Database.ExecuteReader(CommandType, string), EndExecuteReader(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteReader() [2/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteReader ( DbCommand  command,
AsyncCallback  callback,
object  state 
)
virtualinherited

Initiates the asynchronous execution of a command which will return a IDataReader.

Parameters
commandThe DbCommand to execute.
callbackThe 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.
stateAdditional state object to pass to the callback.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteReader, which returns the IDataReader.
See also
Database.ExecuteReader(DbCommand), EndExecuteReader(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteReader() [3/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteReader ( DbCommand  command,
DbTransaction  transaction,
AsyncCallback  callback,
object  state 
)
virtualinherited

Initiates the asynchronous execution of a command inside a transaction which will return a IDataReader.

Parameters
commandThe DbCommand to execute.
transactionThe DbTransaction to execute the command within.
callbackThe 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.
stateAdditional state object to pass to the callback.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteReader, which returns the IDataReader.
See also
Database.ExecuteReader(DbCommand), EndExecuteReader(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteReader() [4/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteReader ( DbTransaction  transaction,
CommandType  commandType,
string  commandText,
AsyncCallback  callback,
object  state 
)
virtualinherited

Initiates the asynchronous execution of the commandText interpreted as specified by the commandType inside an transaction which will return a IDataReader.

Parameters
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
transactionThe DbTransaction to execute the command within.
callbackThe 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.
stateAdditional state object to pass to the callback.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteReader, which returns the IDataReader.
See also
Database.ExecuteReader(CommandType, string), EndExecuteReader(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteReader() [5/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteReader ( DbTransaction  transaction,
string  storedProcedureName,
AsyncCallback  callback,
object  state,
params object[]  parameterValues 
)
virtualinherited

Initiates the asynchronous execution of storedProcedureName using the given parameterValues inside a transaction which will return a IDataReader.

Parameters
transactionThe DbTransaction to execute the command within.
storedProcedureNameThe name of the stored procedure to execute.
callbackThe 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.
stateAdditional state object to pass to the callback.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteReader, which returns the IDataReader.
See also
Database.ExecuteReader(DbTransaction, string, object[]), EndExecuteReader(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteReader() [6/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteReader ( string  storedProcedureName,
AsyncCallback  callback,
object  state,
params object[]  parameterValues 
)
virtualinherited

Initiates the asynchronous execution of storedProcedureName using the given parameterValues which will return a IDataReader.

Parameters
storedProcedureNameThe name of the stored procedure to execute.
callbackThe 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.
stateAdditional state object to pass to the callback.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteReader, which returns the IDataReader.
See also
Database.ExecuteReader(string, object[]), EndExecuteReader(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteScalar() [1/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteScalar ( CommandType  commandType,
string  commandText,
AsyncCallback  callback,
object  state 
)
virtualinherited

Initiates the asynchronous execution of the commandText interpreted as specified by the commandType which will return a single value.

Parameters
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
callbackThe 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.
stateAdditional state object to pass to the callback.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteScalar, which returns the actual result.
See also
Database.ExecuteScalar(CommandType, string), EndExecuteScalar(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteScalar() [2/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteScalar ( DbCommand  command,
AsyncCallback  callback,
object  state 
)
virtualinherited

Initiates the asynchronous execution of a command which will return a single value.

Parameters
commandThe DbCommand to execute.
callbackThe 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.
stateAdditional state object to pass to the callback.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteScalar, which returns the actual result.
See also
Database.ExecuteScalar(DbCommand), EndExecuteScalar(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteScalar() [3/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteScalar ( DbCommand  command,
DbTransaction  transaction,
AsyncCallback  callback,
object  state 
)
virtualinherited

Initiates the asynchronous execution of a command inside a transaction which will return a single value.

Parameters
commandThe DbCommand to execute.
transactionThe DbTransaction to execute the command within.
callbackThe 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.
stateAdditional state object to pass to the callback.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteScalar, which returns the actual result.
See also
Database.ExecuteScalar(DbCommand, DbTransaction), EndExecuteScalar(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteScalar() [4/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteScalar ( DbTransaction  transaction,
CommandType  commandType,
string  commandText,
AsyncCallback  callback,
object  state 
)
virtualinherited

Initiates the asynchronous execution of the commandText interpreted as specified by the commandType inside an transaction which will return a single value.

Parameters
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
transactionThe DbTransaction to execute the command within.
callbackThe 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.
stateAdditional state object to pass to the callback.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteScalar, which returns the actual result.
See also
Database.ExecuteScalar(DbTransaction, CommandType, string), EndExecuteScalar(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteScalar() [5/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteScalar ( DbTransaction  transaction,
string  storedProcedureName,
AsyncCallback  callback,
object  state,
params object[]  parameterValues 
)
virtualinherited

Initiates the asynchronous execution of storedProcedureName using the given parameterValues inside a transaction which will return a single value.

Parameters
transactionThe DbTransaction to execute the command within.
storedProcedureNameThe name of the stored procedure to execute.
callbackThe 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.
stateAdditional state object to pass to the callback.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteScalar, which returns the actual result.
See also
Database.ExecuteScalar(DbTransaction, string, object[]), EndExecuteScalar(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BeginExecuteScalar() [6/6]

virtual IAsyncResult Microsoft.Practices.EnterpriseLibrary.Data.Database.BeginExecuteScalar ( string  storedProcedureName,
AsyncCallback  callback,
object  state,
params object[]  parameterValues 
)
virtualinherited

Initiates the asynchronous execution of storedProcedureName using the given parameterValues which will return a single value.

Parameters
storedProcedureNameThe name of the stored procedure to execute.
callbackThe 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.
stateAdditional state object to pass to the callback.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteScalar, which returns the actual result.
See also
Database.ExecuteScalar(string, object[]), EndExecuteScalar(IAsyncResult)

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ BuildParameterName()

virtual string Microsoft.Practices.EnterpriseLibrary.Data.Database.BuildParameterName ( string  name)
virtualinherited

Builds a value parameter name for the current database.

Parameters
nameThe name of the parameter.
Returns
A correctly formated parameter name.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ ClearParameterCache()

static void Microsoft.Practices.EnterpriseLibrary.Data.Database.ClearParameterCache ( )
staticinherited

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.

◆ ConfigureParameter()

virtual void Microsoft.Practices.EnterpriseLibrary.Data.Database.ConfigureParameter ( DbParameter  param,
string  name,
DbType  dbType,
int  size,
ParameterDirection  direction,
bool  nullable,
byte  precision,
byte  scale,
string  sourceColumn,
DataRowVersion  sourceVersion,
object  value 
)
protectedvirtualinherited

Configures a given DbParameter.

Parameters
paramThe DbParameter to configure.
nameThe name of the parameter.
dbTypeOne of the DbType values.
sizeThe maximum size of the data within the column.
directionOne of the ParameterDirection values.
nullableA value indicating whether the parameter accepts null (Nothing in Visual Basic) values.
precisionThe maximum number of digits used to represent the value .
scaleThe number of decimal places to which value is resolved.
sourceColumnThe name of the source column mapped to the DataSet and used for loading or returning the value .
sourceVersionOne of the DataRowVersion values.
valueThe value of the parameter.

◆ CreateConnection()

virtual DbConnection Microsoft.Practices.EnterpriseLibrary.Data.Database.CreateConnection ( )
virtualinherited

Creates a connection for this database.

Returns
The DbConnection for this database.
See also
DbConnection

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.

◆ CreateParameter() [1/2]

DbParameter Microsoft.Practices.EnterpriseLibrary.Data.Database.CreateParameter ( string  name)
protectedinherited

Creates a new instance of a DbParameter object.

Parameters
nameThe name of the parameter.
Returns
An unconfigured parameter.

◆ CreateParameter() [2/2]

DbParameter Microsoft.Practices.EnterpriseLibrary.Data.Database.CreateParameter ( string  name,
DbType  dbType,
int  size,
ParameterDirection  direction,
bool  nullable,
byte  precision,
byte  scale,
string  sourceColumn,
DataRowVersion  sourceVersion,
object  value 
)
protectedinherited

Adds a new instance of a DbParameter object.

Parameters
nameThe name of the parameter.
dbTypeOne of the DbType values.
sizeThe maximum size of the data within the column.
directionOne of the ParameterDirection values.
nullableA value indicating whether the parameter accepts null (Nothing in Visual Basic) values.
precisionThe maximum number of digits used to represent the value .
scaleThe number of decimal places to which value is resolved.
sourceColumnThe name of the source column mapped to the DataSet and used for loading or returning the value .
sourceVersionOne of the DataRowVersion values.
valueThe value of the parameter.
Returns
A newly created DbParameter fully initialized with given parameters.

◆ CreateWrappedReader()

virtual IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.CreateWrappedReader ( DatabaseConnectionWrapper  connection,
IDataReader  innerReader 
)
protectedvirtualinherited

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.

Parameters
connectionConnection + refcount.
innerReaderThe reader to wrap.
Returns
The new reader.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ DeriveParameters()

override void Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase.DeriveParameters ( DbCommand  discoveryCommand)
protectedvirtual

Retrieves parameter information from the stored procedure specified in the DbCommand and populates the Parameters collection of the specified DbCommand object.

Parameters
discoveryCommandThe DbCommand to do the discovery.
Exceptions
InvalidCastExceptiondiscoveryCommand is not an OleDbCommand.
InvalidOperationExceptionThe underlying OLE DB provider does not support returning stored procedure parameter information, the command text is not a valid stored procedure name, or the CommandType specified was not CommandType.StoredProcedure.

inheritdoc/>

Implements Microsoft.Practices.EnterpriseLibrary.Data.Database.

◆ DiscoverParameters()

void Microsoft.Practices.EnterpriseLibrary.Data.Database.DiscoverParameters ( DbCommand  command)
inherited

Discovers the parameters for a DbCommand.

Parameters
commandThe DbCommand to discover the parameters.

You should get the value of SupportsParemeterDiscovery to detect if parameter discovery is supported for your database provider type.

◆ DoExecuteNonQuery()

int Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteNonQuery ( DbCommand  command)
protectedinherited

Executes the query for command .

Parameters
commandThe DbCommand representing the query to execute.
Returns
The quantity of rows affected.

◆ EndExecuteNonQuery()

virtual int Microsoft.Practices.EnterpriseLibrary.Data.Database.EndExecuteNonQuery ( IAsyncResult  asyncResult)
virtualinherited

Finishes asynchronous execution of a SQL statement, returning the number of affected records.

Parameters
asyncResultThe IAsyncResult returned by a call to any overload of BeginExecuteNonQuery(DbCommand, AsyncCallback, object).
See also
Database.ExecuteNonQuery(DbCommand), BeginExecuteNonQuery(DbCommand, AsyncCallback, object), BeginExecuteNonQuery(DbCommand, DbTransaction, AsyncCallback, object)
Returns
The number of affected records.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ EndExecuteReader()

virtual IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.EndExecuteReader ( IAsyncResult  asyncResult)
virtualinherited

Finishes asynchronous execution of a Transact-SQL statement, returning an IDataReader.

Parameters
asyncResultThe IAsyncResult returned by a call to any overload of BeginExecuteReader.
See also
Database.ExecuteReader(DbCommand), BeginExecuteReader(DbCommand,AsyncCallback,object), BeginExecuteReader(DbCommand, DbTransaction,AsyncCallback,object)
Returns
An IDataReader object that can be used to consume the queried information.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ EndExecuteScalar()

virtual object Microsoft.Practices.EnterpriseLibrary.Data.Database.EndExecuteScalar ( IAsyncResult  asyncResult)
virtualinherited

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.

Parameters
asyncResultThe IAsyncResult returned by a call to any overload of BeginExecuteScalar.
See also
Database.ExecuteScalar(DbCommand), BeginExecuteScalar(DbCommand,AsyncCallback,object), BeginExecuteScalar(DbCommand,DbTransaction,AsyncCallback,object)
Returns
The value of the first column of the first row in the result set returned by the query. If the result didn't have any columns or rows null (Nothing in Visual Basic).

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.

◆ ExecuteDataSet() [1/6]

virtual DataSet Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet ( CommandType  commandType,
string  commandText 
)
virtualinherited

Executes the commandText interpreted as specified by the commandType and returns the results in a new DataSet.

Parameters
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
Returns
A DataSet with the results of the commandText .

◆ ExecuteDataSet() [2/6]

virtual DataSet Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet ( DbCommand  command)
virtualinherited

Executes the command and returns the results in a new DataSet.

Parameters
commandThe DbCommand to execute.
Returns
A DataSet with the results of the command .

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ ExecuteDataSet() [3/6]

virtual DataSet Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet ( DbCommand  command,
DbTransaction  transaction 
)
virtualinherited

Executes the command as part of the transaction and returns the results in a new DataSet.

Parameters
commandThe DbCommand to execute.
transactionThe IDbTransaction to execute the command within.
Returns
A DataSet with the results of the command .

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ ExecuteDataSet() [4/6]

virtual DataSet Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet ( DbTransaction  transaction,
CommandType  commandType,
string  commandText 
)
virtualinherited

Executes the commandText as part of the given transaction and returns the results in a new DataSet.

Parameters
transactionThe IDbTransaction to execute the command within.
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
Returns
A DataSet with the results of the commandText .

◆ ExecuteDataSet() [5/6]

virtual DataSet Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet ( DbTransaction  transaction,
string  storedProcedureName,
params object[]  parameterValues 
)
virtualinherited

Executes the storedProcedureName with parameterValues as part of the transaction and returns the results in a new DataSet within a transaction.

Parameters
transactionThe IDbTransaction to execute the command within.
storedProcedureNameThe stored procedure to execute.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
A DataSet with the results of the storedProcedureName .

◆ ExecuteDataSet() [6/6]

virtual DataSet Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet ( string  storedProcedureName,
params object[]  parameterValues 
)
virtualinherited

Executes the storedProcedureName with parameterValues and returns the results in a new DataSet.

Parameters
storedProcedureNameThe stored procedure to execute.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
A DataSet with the results of the storedProcedureName .

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.

◆ ExecuteNonQuery() [1/6]

virtual int Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery ( CommandType  commandType,
string  commandText 
)
virtualinherited

Executes the commandText interpreted as specified by the commandType and returns the number of rows affected.

Parameters
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
Returns
The number of rows affected.
See also
IDbCommand.ExecuteScalar

◆ ExecuteNonQuery() [2/6]

virtual int Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery ( DbCommand  command)
virtualinherited

Executes the command and returns the number of rows affected.

Parameters
commandThe command that contains the query to execute.
See also
IDbCommand.ExecuteScalar

◆ ExecuteNonQuery() [3/6]

virtual int Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery ( DbCommand  command,
DbTransaction  transaction 
)
virtualinherited

Executes the command within the given transaction , and returns the number of rows affected.

Parameters
commandThe command that contains the query to execute.
transactionThe IDbTransaction to execute the command within.
See also
IDbCommand.ExecuteScalar

◆ ExecuteNonQuery() [4/6]

virtual int Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery ( DbTransaction  transaction,
CommandType  commandType,
string  commandText 
)
virtualinherited

Executes the commandText interpreted as specified by the commandType as part of the given transaction and returns the number of rows affected.

Parameters
transactionThe IDbTransaction to execute the command within.
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
Returns
The number of rows affected
See also
IDbCommand.ExecuteScalar

◆ ExecuteNonQuery() [5/6]

virtual int Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery ( DbTransaction  transaction,
string  storedProcedureName,
params object[]  parameterValues 
)
virtualinherited

Executes the storedProcedureName using the given parameterValues within a transaction and returns the number of rows affected.

Parameters
transactionThe IDbTransaction to execute the command within.
storedProcedureNameThe name of the stored procedure to execute.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
The number of rows affected.
See also
IDbCommand.ExecuteScalar

◆ ExecuteNonQuery() [6/6]

virtual int Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery ( string  storedProcedureName,
params object[]  parameterValues 
)
virtualinherited

Executes the storedProcedureName using the given parameterValues and returns the number of rows affected.

Parameters
storedProcedureNameThe name of the stored procedure to execute.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
The number of rows affected
See also
IDbCommand.ExecuteScalar

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.

◆ ExecuteReader() [1/6]

IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader ( CommandType  commandType,
string  commandText 
)
inherited

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.

Parameters
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
Returns
An IDataReader object.

◆ ExecuteReader() [2/6]

virtual IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader ( DbCommand  command)
virtualinherited

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.

Parameters
commandThe command that contains the query to execute.
Returns
An IDataReader object.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ ExecuteReader() [3/6]

virtual IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader ( DbCommand  command,
DbTransaction  transaction 
)
virtualinherited

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.

Parameters
commandThe command that contains the query to execute.
transactionThe IDbTransaction to execute the command within.
Returns
An IDataReader object.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ ExecuteReader() [4/6]

IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader ( DbTransaction  transaction,
CommandType  commandType,
string  commandText 
)
inherited

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.

Parameters
transactionThe IDbTransaction to execute the command within.
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
Returns
An IDataReader object.

◆ ExecuteReader() [5/6]

IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader ( DbTransaction  transaction,
string  storedProcedureName,
params object[]  parameterValues 
)
inherited

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.

Parameters
transactionThe IDbTransaction to execute the command within.
storedProcedureNameThe command that contains the query to execute.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
An IDataReader object.

◆ ExecuteReader() [6/6]

IDataReader Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader ( string  storedProcedureName,
params object[]  parameterValues 
)
inherited

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.

Parameters
storedProcedureNameThe command that contains the query to execute.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
An IDataReader object.

◆ ExecuteScalar() [1/6]

virtual object Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar ( CommandType  commandType,
string  commandText 
)
virtualinherited

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.

Parameters
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
Returns
The first column of the first row in the result set.
See also
IDbCommand.ExecuteScalar

◆ ExecuteScalar() [2/6]

virtual object Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar ( DbCommand  command)
virtualinherited

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.

Parameters
commandThe command that contains the query to execute.
Returns
The first column of the first row in the result set.
See also
IDbCommand.ExecuteScalar

◆ ExecuteScalar() [3/6]

virtual object Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar ( DbCommand  command,
DbTransaction  transaction 
)
virtualinherited

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.

Parameters
commandThe command that contains the query to execute.
transactionThe IDbTransaction to execute the command within.
Returns
The first column of the first row in the result set.
See also
IDbCommand.ExecuteScalar

◆ ExecuteScalar() [4/6]

virtual object Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar ( DbTransaction  transaction,
CommandType  commandType,
string  commandText 
)
virtualinherited

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.

Parameters
transactionThe IDbTransaction to execute the command within.
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
Returns
The first column of the first row in the result set.
See also
IDbCommand.ExecuteScalar

◆ ExecuteScalar() [5/6]

virtual object Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar ( DbTransaction  transaction,
string  storedProcedureName,
params object[]  parameterValues 
)
virtualinherited

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.

Parameters
transactionThe IDbTransaction to execute the command within.
storedProcedureNameThe stored procedure to execute.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
The first column of the first row in the result set.
See also
IDbCommand.ExecuteScalar

◆ ExecuteScalar() [6/6]

virtual object Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar ( string  storedProcedureName,
params object[]  parameterValues 
)
virtualinherited

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.

Parameters
storedProcedureNameThe stored procedure to execute.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.
Returns
The first column of the first row in the result set.
See also
IDbCommand.ExecuteScalar

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.

◆ GetDataAdapter() [1/2]

DbDataAdapter Microsoft.Practices.EnterpriseLibrary.Data.Database.GetDataAdapter ( )
inherited

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.

Returns
A DbDataAdapter.
See also
DbDataAdapter

◆ GetDataAdapter() [2/2]

DbDataAdapter Microsoft.Practices.EnterpriseLibrary.Data.Database.GetDataAdapter ( UpdateBehavior  updateBehavior)
protectedinherited

Gets the DbDataAdapter with the given update behavior and connection from the proper derived class.

Parameters
updateBehaviorOne of the UpdateBehavior values.
Returns
A DbDataAdapter.
See also
DbDataAdapter

◆ GetOpenConnection()

DatabaseConnectionWrapper Microsoft.Practices.EnterpriseLibrary.Data.Database.GetOpenConnection ( )
protectedinherited

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.

Returns

◆ GetParameterValue()

virtual object Microsoft.Practices.EnterpriseLibrary.Data.Database.GetParameterValue ( DbCommand  command,
string  name 
)
virtualinherited

Gets a parameter value.

Parameters
commandThe command that contains the parameter.
nameThe name of the parameter.
Returns
The value of the parameter.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ GetSqlStringCommand()

DbCommand Microsoft.Practices.EnterpriseLibrary.Data.Database.GetSqlStringCommand ( string  query)
inherited

Creates a DbCommand for a SQL query.

Parameters
queryThe text of the query.
Returns
The DbCommand for the SQL query.
Exceptions
ArgumentExceptionquery is null or empty.

◆ GetStoredProcCommand() [1/2]

virtual DbCommand Microsoft.Practices.EnterpriseLibrary.Data.Database.GetStoredProcCommand ( string  storedProcedureName)
virtualinherited

Creates a DbCommand for a stored procedure.

Parameters
storedProcedureNameThe name of the stored procedure.
Returns
The DbCommand for the stored procedure.
Exceptions
ArgumentExceptionstoredProcedureName is null or empty.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ GetStoredProcCommand() [2/2]

virtual DbCommand Microsoft.Practices.EnterpriseLibrary.Data.Database.GetStoredProcCommand ( string  storedProcedureName,
params object[]  parameterValues 
)
virtualinherited

Creates a DbCommand for a stored procedure.

Parameters
storedProcedureNameThe name of the stored procedure.
parameterValuesThe list of parameters for the procedure.
Returns
The DbCommand for the stored procedure.

The parameters for the stored procedure will be discovered and the values are assigned in positional order.

Exceptions
ArgumentExceptionstoredProcedureName is null or empty.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ GetStoredProcCommandWithSourceColumns()

DbCommand Microsoft.Practices.EnterpriseLibrary.Data.Database.GetStoredProcCommandWithSourceColumns ( string  storedProcedureName,
params string[]  sourceColumns 
)
inherited

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.

Parameters
storedProcedureNameThe name of the stored procedure.
sourceColumnsThe list of DataFields for the procedure.
Returns
The DbCommand for the stored procedure.

◆ GetWrappedConnection()

virtual DatabaseConnectionWrapper Microsoft.Practices.EnterpriseLibrary.Data.Database.GetWrappedConnection ( )
protectedvirtualinherited

Gets a "wrapped" connection for use outside a transaction.

Returns
The wrapped connection.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.

◆ LoadDataSet() [1/8]

virtual void Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet ( CommandType  commandType,
string  commandText,
DataSet  dataSet,
string[]  tableNames 
)
virtualinherited

Loads a DataSet from command text.

Parameters
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
dataSetThe DataSet to fill.
tableNamesAn array of table name mappings for the DataSet.

◆ LoadDataSet() [2/8]

virtual void Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet ( DbCommand  command,
DataSet  dataSet,
string  tableName 
)
virtualinherited

Executes the command and adds a new DataTable to the existing DataSet.

Parameters
commandThe DbCommand to execute.
dataSetThe DataSet to load.
tableNameThe name for the new DataTable to add to the DataSet.
Exceptions
System.ArgumentNullExceptionAny input parameter was null (Nothing in Visual Basic)
System.ArgumentExceptiontableName was an empty string

◆ LoadDataSet() [3/8]

virtual void Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet ( DbCommand  command,
DataSet  dataSet,
string  tableName,
DbTransaction  transaction 
)
virtualinherited

Executes the command within the given transaction and adds a new DataTable to the existing DataSet.

Parameters
commandThe DbCommand to execute.
dataSetThe DataSet to load.
tableNameThe name for the new DataTable to add to the DataSet.
transactionThe IDbTransaction to execute the command within.
Exceptions
System.ArgumentNullExceptionAny input parameter was null (Nothing in Visual Basic).
System.ArgumentExceptiontableName was an empty string.

◆ LoadDataSet() [4/8]

virtual void Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet ( DbCommand  command,
DataSet  dataSet,
string[]  tableNames 
)
virtualinherited

Loads a DataSet from a DbCommand.

Parameters
commandThe command to execute to fill the DataSet.
dataSetThe DataSet to fill.
tableNamesAn array of table name mappings for the DataSet.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ LoadDataSet() [5/8]

virtual void Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet ( DbCommand  command,
DataSet  dataSet,
string[]  tableNames,
DbTransaction  transaction 
)
virtualinherited

Loads a DataSet from a DbCommand in a transaction.

Parameters
commandThe command to execute to fill the DataSet.
dataSetThe DataSet to fill.
tableNamesAn array of table name mappings for the DataSet.
transactionThe IDbTransaction to execute the command in.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ LoadDataSet() [6/8]

void Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet ( DbTransaction  transaction,
CommandType  commandType,
string  commandText,
DataSet  dataSet,
string[]  tableNames 
)
inherited

Loads a DataSet from command text in a transaction.

Parameters
transactionThe IDbTransaction to execute the command in.
commandTypeOne of the CommandType values.
commandTextThe command text to execute.
dataSetThe DataSet to fill.
tableNamesAn array of table name mappings for the DataSet.

◆ LoadDataSet() [7/8]

virtual void Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet ( DbTransaction  transaction,
string  storedProcedureName,
DataSet  dataSet,
string[]  tableNames,
params object[]  parameterValues 
)
virtualinherited

Loads a DataSet with the results returned from a stored procedure executed in a transaction.

Parameters
transactionThe IDbTransaction to execute the stored procedure in.
storedProcedureNameThe stored procedure name to execute.
dataSetThe DataSet to fill.
tableNamesAn array of table name mappings for the DataSet.
parameterValuesAn array of parameters to pass to the stored procedure. The parameter values must be in call order as they appear in the stored procedure.

◆ LoadDataSet() [8/8]

virtual void Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet ( string  storedProcedureName,
DataSet  dataSet,
string[]  tableNames,
params object[]  parameterValues 
)
virtualinherited

Loads a DataSet with the results returned from a stored procedure.

Parameters
storedProcedureNameThe stored procedure name to execute.
dataSetThe DataSet to fill.
tableNamesAn array of table name mappings for the DataSet.
parameterValuesAn 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.

◆ PrepareCommand() [1/2]

static void Microsoft.Practices.EnterpriseLibrary.Data.Database.PrepareCommand ( DbCommand  command,
DbConnection  connection 
)
staticprotectedinherited

Assigns a connection to the command and discovers parameters if needed.

Parameters
commandThe command that contains the query to prepare.
connectionThe connection to assign to the command.

◆ PrepareCommand() [2/2]

static void Microsoft.Practices.EnterpriseLibrary.Data.Database.PrepareCommand ( DbCommand  command,
DbTransaction  transaction 
)
staticprotectedinherited

Assigns a transaction to the command and discovers parameters if needed.

Parameters
commandThe command that contains the query to prepare.
transactionThe transaction to assign to the command.

◆ SameNumberOfParametersAndValues()

override bool Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase.SameNumberOfParametersAndValues ( DbCommand  command,
object[]  values 
)
protectedvirtual

Determines if the number of parameters in the command matches the array of parameter values.

Parameters
commandThe DbCommand containing the parameters.
valuesThe array of parameter values.
Returns
true if the number of parameters and values match; otherwise, false.

Reimplemented from Microsoft.Practices.EnterpriseLibrary.Data.Database.

◆ SetParameterValue()

virtual void Microsoft.Practices.EnterpriseLibrary.Data.Database.SetParameterValue ( DbCommand  command,
string  parameterName,
object  value 
)
virtualinherited

Sets a parameter value.

Parameters
commandThe command with the parameter.
parameterNameThe parameter name.
valueThe parameter value.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.

◆ UpdateDataSet() [1/4]

int Microsoft.Practices.EnterpriseLibrary.Data.Database.UpdateDataSet ( DataSet  dataSet,
string  tableName,
DbCommand  insertCommand,
DbCommand  updateCommand,
DbCommand  deleteCommand,
DbTransaction  transaction 
)
inherited

Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet within a transaction.

Parameters
dataSetThe DataSet used to update the data source.
tableNameThe name of the source table to use for table mapping.
insertCommandThe DbCommand executed when DataRowState is DataRowState.Added.
updateCommandThe DbCommand executed when DataRowState is DataRowState.Modified.
deleteCommandThe DbCommand executed when DataRowState is DataRowState.Deleted.
transactionThe IDbTransaction to use.
Returns
Number of records affected.

◆ UpdateDataSet() [2/4]

int Microsoft.Practices.EnterpriseLibrary.Data.Database.UpdateDataSet ( DataSet  dataSet,
string  tableName,
DbCommand  insertCommand,
DbCommand  updateCommand,
DbCommand  deleteCommand,
DbTransaction  transaction,
int?  updateBatchSize 
)
inherited

Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet within a transaction.

Parameters
dataSetThe DataSet used to update the data source.
tableNameThe name of the source table to use for table mapping.
insertCommandThe DbCommand executed when DataRowState is DataRowState.Added.
updateCommandThe DbCommand executed when DataRowState is DataRowState.Modified.
deleteCommandThe DbCommand executed when DataRowState is DataRowState.Deleted.
transactionThe IDbTransaction to use.
updateBatchSizeThe 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.
Returns
Number of records affected.

◆ UpdateDataSet() [3/4]

int Microsoft.Practices.EnterpriseLibrary.Data.Database.UpdateDataSet ( DataSet  dataSet,
string  tableName,
DbCommand  insertCommand,
DbCommand  updateCommand,
DbCommand  deleteCommand,
UpdateBehavior  updateBehavior 
)
inherited

Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet.

Parameters
dataSetThe DataSet used to update the data source.
tableNameThe name of the source table to use for table mapping.
insertCommandThe DbCommand executed when DataRowState is DataRowState.Added
updateCommandThe DbCommand executed when DataRowState is DataRowState.Modified
deleteCommandThe DbCommand executed when DataRowState is DataRowState.Deleted
updateBehaviorOne of the UpdateBehavior values.
Returns
number of records affected

◆ UpdateDataSet() [4/4]

int Microsoft.Practices.EnterpriseLibrary.Data.Database.UpdateDataSet ( DataSet  dataSet,
string  tableName,
DbCommand  insertCommand,
DbCommand  updateCommand,
DbCommand  deleteCommand,
UpdateBehavior  updateBehavior,
int?  updateBatchSize 
)
inherited

Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet.

Parameters
dataSetThe DataSet used to update the data source.
tableNameThe name of the source table to use for table mapping.
insertCommandThe DbCommand executed when DataRowState is DataRowState.Added
updateCommandThe DbCommand executed when DataRowState is DataRowState.Modified
deleteCommandThe DbCommand executed when DataRowState is DataRowState.Deleted
updateBehaviorOne of the UpdateBehavior values.
updateBatchSizeThe number of database commands to execute in a batch.
Returns
number of records affected

◆ UserParametersStartIndex()

override int Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase.UserParametersStartIndex ( )
protectedvirtual

Returns the starting index for parameters in a command.

Returns
The starting index for parameters in a command.

Reimplemented from Microsoft.Practices.EnterpriseLibrary.Data.Database.

Property Documentation

◆ ConnectionString

string Microsoft.Practices.EnterpriseLibrary.Data.Database.ConnectionString
getinherited

Gets the string used to open a database.

The string used to open a database.

See also
DbConnection.ConnectionString

◆ ConnectionStringNoCredentials

string Microsoft.Practices.EnterpriseLibrary.Data.Database.ConnectionStringNoCredentials
getprotectedinherited

Gets the connection string without the username and password.

The connection string without the username and password.

See also
ConnectionString

◆ ConnectionStringWithoutCredentials

string Microsoft.Practices.EnterpriseLibrary.Data.Database.ConnectionStringWithoutCredentials
getinherited

Gets the connection string without credentials.

The connection string without credentials.

◆ DbProviderFactory

DbProviderFactory Microsoft.Practices.EnterpriseLibrary.Data.Database.DbProviderFactory
getinherited

Gets the DbProviderFactory used by the database instance.

See also
DbProviderFactory

◆ SupportsAsync

virtual bool Microsoft.Practices.EnterpriseLibrary.Data.Database.SupportsAsync
getinherited

Does this Database object support asynchronous execution?

Base class always returns false.

◆ SupportsParemeterDiscovery

override bool Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase.SupportsParemeterDiscovery
get

Determines whether the database provider supports parameter discovery. This depends on the underlying OLE DB provider.

Returns true, but you should consult the documentation for the underlying OLE DB provider.

See also
DeriveParameters(DbCommand)

The documentation for this class was generated from the following file: