Execute an IDbCommand (that returns a resultset and takes no parameters) against the database specified in
the connection String.
Namespace: CodeSmith.EngineAssembly: CodeSmith.Engine (in CodeSmith.Engine.dll) Version: 6.0.0.0 (7.0.0.15127)
Syntax
C# |
---|
public virtual DataSet ExecuteDataset( string connectionString, CommandType commandType, string commandText ) |
Visual Basic |
---|
Public Overridable Function ExecuteDataset ( connectionString As String, commandType As CommandType, commandText As String ) As DataSet |
Parameters
- connectionString
- Type: System..::..String
A valid connection string for an IDbConnection
- commandType
- Type: System.Data..::..CommandType
The CommandType (stored procedure, text, etc.)
- commandText
- Type: System..::..String
The stored procedure name or SQL command
Return Value
Type: DataSetA DataSet containing the resultset generated by the command
Return Value
Type: DataSetA DataSet containing the resultset generated by the command
Examples
Copy | |
---|---|
DataSet ds = helper.ExecuteDataset(connString, CommandType.StoredProcedure, "GetOrders"); |
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | Thrown if connectionString is null |
System..::..ArgumentNullException | Thrown if commandText is null |