ExecuteDataSet(IDbTransaction,CommandType,String) Method
A live transaction connected to the database
The CommandType to use when executing the commandText statement.
The text command to execute. The default value is an empty string ("").
Executes the the specified SQL using the provided database transaction and returns the results as a DataSet
Syntax
'Declaration
Public Overloads Shared Function ExecuteDataSet( _
ByVal _transaction_ As IDbTransaction, _
ByVal _commandType_ As CommandType, _
ByVal _commandText_ As String _
) As DataSet
public static DataSet ExecuteDataSet(
IDbTransaction _transaction_,
CommandType _commandType_,
string _commandText_
)
Parameters
transaction
A live transaction connected to the database
commandType
The CommandType to use when executing the commandText statement.
commandText
The text command to execute. The default value is an empty string ("").
Return Value
A DataSet with zero or more DataTable objects each containing zero or more rows.
Remarks
The transaction parameter must be an open and live transaction. After the call to this method, the transaction will remain live and open.
Not all providers return a DataSet with the same structure if no results are returned by the query. Some providers return an empty DataSet. Some providers return a DataSet with a single DataTable which contains zero rows. Test for tables and rows using the Count property on the DataSet and any DataTables before assuming any Tables or Rows exist.
In no case will the DataSet returned be a null reference (Nothing in Visual Basic).
When the commandType parameter is set to StoredProcedure, set the commandText parameter to the name of the stored procedure. The user may be required to use escape character syntax if the stored procedure name contains any special characters. The command will call this stored procedure when you call one of the Execute methods.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server family