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.SqlCe.SqlCeDatabase Class Reference

Provides helper methods to make working with a Sql Server Compact Edition database easier. More...

Inheritance diagram for Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase:
Microsoft.Practices.EnterpriseLibrary.Data.Database

Public Member Functions

 SqlCeDatabase (string connectionString)
 Initializes a new instance of the SqlCeDatabase class with a connection string. More...
 
void CloseSharedConnection ()
 This will close the "keep alive" connection that is kept open after you first access the database through this class. Calling this method will close the "keep alive" connection for all instances. The next database access will open a new "keep alive" connection. More...
 
override DbConnection CreateConnection ()
 Creates a connection for this database. More...
 
override DataSet ExecuteDataSet (string storedProcedureName, params object[] parameterValues)
 Stored procedures are not supported in SQL Server CE. More...
 
override int ExecuteNonQuery (string storedProcedureName, params object[] parameterValues)
 Stored procedures are not supported in SQL Server CE. More...
 
override object ExecuteScalar (string storedProcedureName, params object[] parameterValues)
 Stored procedures are not supported in SQL Server CE. More...
 
override void LoadDataSet (string storedProcedureName, DataSet dataSet, string[] tableNames, params object[] parameterValues)
 Stored procedures are not supported in SQL Server CE. More...
 
override DbCommand GetStoredProcCommand (string storedProcedureName, params object[] parameterValues)
 Because SQL Server CE doesn't support stored procedures, we've changed queries that take a stored procedure name to take a SQL statement instead. More...
 
override DbCommand GetStoredProcCommand (string storedProcedureName)
 Because SQL Server CE doesn't support stored procedures, we've changed queries that take a stored procedure name to take a SQL statement instead. More...
 
override string BuildParameterName (string name)
 Builds a value parameter name for the current database. More...
 
void CreateFile ()
 Creates a new, empty database file using the file name provided in the Data Source attribute of the connection string. More...
 
virtual DbParameter CreateParameter (string name, DbType type, int size, object value)
 Creates a new parameter and sets the name of the parameter. More...
 
virtual DataSet ExecuteDataSetSql (string sqlCommand, params DbParameter[] parameters)
 Executes a SQL SELECT statement and returns a dataset. More...
 
virtual int ExecuteNonQuerySql (string sqlCommand, params DbParameter[] parameters)
 Executes a SQL statement directly, because SQL Server CE doesn't support stored procedures. More...
 
virtual int ExecuteNonQuerySql (string sqlCommand, out int lastAddedId, params DbParameter[] parameters)
 Executes an INSERT statement and given the identity of the row that was inserted for identity tables. More...
 
virtual IDataReader ExecuteReaderSql (string sqlCommand, params DbParameter[] parameters)
 Executes a command and returns a DbDataReader that contains the rows returned. More...
 
virtual SqlCeResultSet ExecuteResultSet (DbCommand command, ResultSetOptions options, params DbParameter[] parameters)
 SQL Server CE provides a new type of data reader, the SqlCeResultSet, that provides new abilities and better performance over a standard reader. This method provides access to this reader. More...
 
virtual SqlCeResultSet ExecuteResultSet (DbCommand command, params DbParameter[] parameters)
 SQL Server CE provides a new type of data reader, the SqlCeResultSet, that provides new abilities and better performance over a standard reader. This method provides access to this reader. More...
 
virtual SqlCeResultSet ExecuteResultSet (DbCommand command, DbTransaction transaction, ResultSetOptions options, params DbParameter[] parameters)
 SQL Server CE provides a new type of data reader, the SqlCeResultSet, that provides new abilities and better performance over a standard reader. This method provides access to this reader. More...
 
virtual SqlCeResultSet ExecuteResultSet (DbCommand command, DbTransaction transaction, params DbParameter[] parameters)
 SQL Server CE provides a new type of data reader, the SqlCeResultSet, that provides new abilities and better performance over a standard reader. This method provides access to this reader. More...
 
virtual object ExecuteScalarSql (string sqlCommand, params DbParameter[] parameters)
 Executes the sqlCommand 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 bool TableExists (string tableName)
 Checks to see if a table exists in the open database. 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...
 
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 (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 (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 (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 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 (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 DatabaseConnectionWrapper GetWrappedConnection ()
 Gets a "wrapped" connection for use outside a transaction. More...
 
override void DeriveParameters (DbCommand discoveryCommand)
 Don't need an implementation for SQL Server CE. More...
 
override void SetUpRowUpdatedEvent (DbDataAdapter adapter)
 Sets the RowUpdated event for the data adapter. More...
 
void AddParameters (DbCommand command, params DbParameter[] parameters)
 Adds any parameters to the 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 bool SameNumberOfParametersAndValues (DbCommand command, object[] values)
 Determines if the number of parameters in the command matches the array of parameter values. 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

char ParameterToken [get]
 Gets the parameter token used to delimit parameters for the SQL Server database. 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 SupportsParemeterDiscovery [get]
 Does this Database object support parameter discovery? More...
 
virtual bool SupportsAsync [get]
 Does this Database object support asynchronous execution? More...
 

Detailed Description

Provides helper methods to make working with a Sql Server Compact Edition database easier.

Because SQL Server CE has no connection pooling and the cost of opening the initial connection is high, this class implements a simple connection pool.

SQL Server CE requires full trust to run, so it cannot be used in partial-trust environments.

Constructor & Destructor Documentation

◆ SqlCeDatabase()

Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.SqlCeDatabase ( string  connectionString)

Initializes a new instance of the SqlCeDatabase class with a connection string.

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.

◆ AddParameters()

void Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.AddParameters ( DbCommand  command,
params DbParameter[]  parameters 
)
protected

Adds any parameters to the command.

Parameters
commandThe command object you want prepared.
parametersZero or more parameters to add to the command.

◆ 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()

override string Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.BuildParameterName ( string  name)
virtual

Builds a value parameter name for the current database.

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

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

◆ 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.

◆ CloseSharedConnection()

void Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.CloseSharedConnection ( )

This will close the "keep alive" connection that is kept open after you first access the database through this class. Calling this method will close the "keep alive" connection for all instances. The next database access will open a new "keep alive" connection.

◆ 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()

override DbConnection Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.CreateConnection ( )
virtual

Creates a connection for this database.

This method has been overridden to support keeping a single connection open until you explicitly close it with a call to CloseSharedConnection.

Returns
The DbConnection for this database.
See also
DbConnection

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

◆ CreateFile()

void Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.CreateFile ( )

Creates a new, empty database file using the file name provided in the Data Source attribute of the connection string.

◆ CreateParameter() [1/3]

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/3]

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.

◆ CreateParameter() [3/3]

virtual DbParameter Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.CreateParameter ( string  name,
DbType  type,
int  size,
object  value 
)
virtual

Creates a new parameter and sets the name of the parameter.

Parameters
nameThe name of the parameter.
typeThe type of the parameter.
sizeThe size of the parameter.
valueThe value you want to assign to the parameter. A null value will be converted to a DBNull value in the parameter.
Returns
A new DbParameter instance of the correct type for this database.

The database will automatically add the correct prefix (for example, "@" for SQL Server) to the parameter name. You can just supply the name without a prefix.

◆ 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.SqlCe.SqlCeDatabase.DeriveParameters ( DbCommand  discoveryCommand)
protectedvirtual

Don't need an implementation for SQL Server CE.

Parameters
discoveryCommand

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]

override DataSet Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteDataSet ( string  storedProcedureName,
params object[]  parameterValues 
)
virtual

Stored procedures are not supported in SQL Server CE.

Parameters
storedProcedureName
parameterValues
Returns
Exceptions
NotImplementedExceptionIn all cases.

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

◆ ExecuteDataSetSql()

virtual DataSet Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteDataSetSql ( string  sqlCommand,
params DbParameter[]  parameters 
)
virtual

Executes a SQL SELECT statement and returns a dataset.

Parameters
sqlCommand
parameters
Returns

◆ 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]

override int Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteNonQuery ( string  storedProcedureName,
params object[]  parameterValues 
)
virtual

Stored procedures are not supported in SQL Server CE.

Parameters
storedProcedureName
parameterValues
Returns
Exceptions
NotImplementedExceptionIn all cases.

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

◆ ExecuteNonQuerySql() [1/2]

virtual int Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteNonQuerySql ( string  sqlCommand,
out int  lastAddedId,
params DbParameter[]  parameters 
)
virtual

Executes an INSERT statement and given the identity of the row that was inserted for identity tables.

Parameters
sqlCommandThe SQL statement to execute.
lastAddedIdThe identity value for the last row added, or DBNull.
parametersZero or more parameters.
Returns
The number of rows affected.

◆ ExecuteNonQuerySql() [2/2]

virtual int Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteNonQuerySql ( string  sqlCommand,
params DbParameter[]  parameters 
)
virtual

Executes a SQL statement directly, because SQL Server CE doesn't support stored procedures.

Parameters
sqlCommandThe SQL statement to execute.
parametersAn optional set of parameters and values.
Returns
Number of rows affected.

◆ 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.

◆ ExecuteReaderSql()

virtual IDataReader Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteReaderSql ( string  sqlCommand,
params DbParameter[]  parameters 
)
virtual

Executes a command and returns a DbDataReader that contains the rows returned.

Parameters
sqlCommandThe SQL query to execute.
parametersZero or more parameters for the query.
Returns
A DbDataReader that contains the rows returned by the query.

◆ ExecuteResultSet() [1/4]

virtual SqlCeResultSet Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteResultSet ( DbCommand  command,
DbTransaction  transaction,
params DbParameter[]  parameters 
)
virtual

SQL Server CE provides a new type of data reader, the SqlCeResultSet, that provides new abilities and better performance over a standard reader. This method provides access to this reader.

Unlike other Execute... methods that take a DbCommand instance, this method does not set the command behavior to close the connection when you close the reader. That means you'll need to close the connection yourself, by calling the command.Connection.Close() method after you're finished using the reader.

Parameters
commandThe command that contains the SQL SELECT statement to execute.
transactionTransaction to execute the command under.
parametersAn option set of DbParameter parameters.
Returns
The reader in the form of a SqlCeResultSet.

◆ ExecuteResultSet() [2/4]

virtual SqlCeResultSet Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteResultSet ( DbCommand  command,
DbTransaction  transaction,
ResultSetOptions  options,
params DbParameter[]  parameters 
)
virtual

SQL Server CE provides a new type of data reader, the SqlCeResultSet, that provides new abilities and better performance over a standard reader. This method provides access to this reader.

Unlike other Execute... methods that take a DbCommand instance, this method does not set the command behavior to close the connection when you close the reader. That means you'll need to close the connection yourself, by calling the command.Connection.Close() method after you're finished using the reader.

Parameters
commandThe command that contains the SQL SELECT statement to execute.
transactionTransaction to execute the command under.
optionsControls how the SqlCeResultSet behaves.
parametersAn option set of DbParameter parameters.
Returns
The reader in the form of a SqlCeResultSet.

◆ ExecuteResultSet() [3/4]

virtual SqlCeResultSet Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteResultSet ( DbCommand  command,
params DbParameter[]  parameters 
)
virtual

SQL Server CE provides a new type of data reader, the SqlCeResultSet, that provides new abilities and better performance over a standard reader. This method provides access to this reader.

The SqlCeResultSet returned from this method will close the connection on dispose.

Parameters
commandThe command that contains the SQL SELECT statement to execute.
parametersAn option set of DbParameter parameters.
Returns
The reader in the form of a SqlCeResultSet.

◆ ExecuteResultSet() [4/4]

virtual SqlCeResultSet Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteResultSet ( DbCommand  command,
ResultSetOptions  options,
params DbParameter[]  parameters 
)
virtual

SQL Server CE provides a new type of data reader, the SqlCeResultSet, that provides new abilities and better performance over a standard reader. This method provides access to this reader.

The SqlCeResultSet returned from this method will close the connection on dispose.

Parameters
commandThe command that contains the SQL SELECT statement to execute.
optionsControls how the SqlCeResultSet behaves.
parametersAn option set of DbParameter parameters.
Returns
The reader in the form of a SqlCeResultSet.

◆ 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]

override object Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteScalar ( string  storedProcedureName,
params object[]  parameterValues 
)
virtual

Stored procedures are not supported in SQL Server CE.

Parameters
storedProcedureName
parameterValues
Returns
Exceptions
NotImplementedExceptionIn all cases.

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

◆ ExecuteScalarSql()

virtual object Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ExecuteScalarSql ( string  sqlCommand,
params DbParameter[]  parameters 
)
virtual

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

Parameters
sqlCommandThe SQL statement to execute.
parametersZero or more parameters for the query.
Returns
The first column of the first row in the result set.
See also
IDbCommand.ExecuteScalar

◆ 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]

override DbCommand Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.GetStoredProcCommand ( string  storedProcedureName)
virtual

Because SQL Server CE doesn't support stored procedures, we've changed queries that take a stored procedure name to take a SQL statement instead.

Parameters
storedProcedureNameThe SQL statement to execute.
Returns
Exceptions
NotImplementedExceptionIn all cases.

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

◆ GetStoredProcCommand() [2/2]

override DbCommand Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.GetStoredProcCommand ( string  storedProcedureName,
params object[]  parameterValues 
)
virtual

Because SQL Server CE doesn't support stored procedures, we've changed queries that take a stored procedure name to take a SQL statement instead.

Parameters
storedProcedureName
parameterValues
Returns
Exceptions
NotImplementedExceptionIn all cases.

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

◆ 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()

override DatabaseConnectionWrapper Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.GetWrappedConnection ( )
protectedvirtual

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

Returns
The wrapped connection.

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

◆ 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]

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

Stored procedures are not supported in SQL Server CE.

Parameters
storedProcedureName
dataSet
tableNames
parameterValues
Exceptions
NotImplementedExceptionIn all cases.

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

◆ 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()

virtual bool Microsoft.Practices.EnterpriseLibrary.Data.Database.SameNumberOfParametersAndValues ( DbCommand  command,
object[]  values 
)
protectedvirtualinherited

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 in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase.

◆ 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.

◆ SetUpRowUpdatedEvent()

override void Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.SetUpRowUpdatedEvent ( DbDataAdapter  adapter)
protectedvirtual

Sets the RowUpdated event for the data adapter.

Parameters
adapterThe DbDataAdapter to set the event.

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

◆ TableExists()

virtual bool Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.TableExists ( string  tableName)
virtual

Checks to see if a table exists in the open database.

Parameters
tableNameName of the table.
Returns
>true if the table exists; otherwise, false.

◆ 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()

virtual int Microsoft.Practices.EnterpriseLibrary.Data.Database.UserParametersStartIndex ( )
protectedvirtualinherited

Returns the starting index for parameters in a command.

Returns
The starting index for parameters in a command.

Reimplemented in Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase, and Microsoft.Practices.EnterpriseLibrary.Data.OleDb.OleDbDatabase.

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

◆ ParameterToken

char Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeDatabase.ParameterToken
getprotected

Gets the parameter token used to delimit parameters for the SQL Server database.

The "@" symbol.

◆ SupportsAsync

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

Does this Database object support asynchronous execution?

Base class always returns false.

◆ SupportsParemeterDiscovery

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

Does this Database object support parameter discovery?

Base class always returns false.


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