SAPCommand class in the SAP adapter

This command represents a SQL query to be executed on the SAP backend. The .NET Framework Data Provider for mySAP Business Suite currently supports SELECT and EXEC statements only. SELECT statements enable extraction of data from a single SAP table, and EXEC statements enable users to execute RFCs on the SAP server.

This is derived from System.Data.Common.DbCommand.

Supported Properties

Name Get/Set Description
CommandText Get and Set Supports SELECT and EXEC statements. For more information about the SELECT statement, see Syntax for a SELECT Statement in SAP. For more information about the EXEC statement, see Syntax for an EXEC Statement in SAP.
CommandTimeout Get and Set Not supported.
CommandType Get and Set CommandType.Text supported.
Connection Get and Set The underlying SAP connection on which the command will be executed.
DesignTimeVisible Get Not supported. Returns false.
Parameters Get Parameter collection used for this command.
UpdatedRowSource - Not supported.

Supported Methods

Name Description
Cancel() Cancels the command while retrieving data in batches. Cancellation happens after a batch is retrieved.
ExecuteNonQuery() Does not output any DataReader. However, values will be available via bound parameters.
ExecuteReader() Outputs a DataReader with all complex type Export and Table parameters as resultsets. The values can also be obtained via bound parameters.
ExecuteReader(CommandBehavior) CommandBehaviors supported are:

- Default
- SingleResult
- SingleRow
- SchemaOnly
ExecuteScalar() Maps to:

- CommandBehaviour.SingleRow for SELECT statements.
- CommandBehaviour.SingleResult for EXEC statements.
Prepare() - EXEC supports bind parameters.
- SELECT supports bind parameters.

Supported Constructors

Name Description
SAPCommand() Create a new instance of SAPCommand.
SAPCommand(string) SAPCommand with command text.
SAPCommand(string, SAPConnection) SAPCommand with command text and the SAPConnection object using which the command will be executed

See Also

Extend ADO.NET Interfaces with the SAP adapter