SAPConnection class in the SAP adapter
The following section lists the methods and properties for the SAPConnection class. This represents an ADO.NET connection to the SAP application server.
This is derived from System.Data.Common.DbConnection.
Supported Properties
Name | Get/Set | Description |
---|---|---|
ConnectionString | Get and Set | See Read about Data Provider types for the SAP Connection String. |
ConnectionTimeout | Get | Not supported. Returns 0. |
Database | Get | SAP System ID. |
DataSource | Get | This returns the name of the SAP application server host. |
ServerVersion | Get | This shows the release number for the SAP instance and not the SAP Server version. For example, if the ADO.NET client is connecting to SAP Server version 4.6 with the instance release number 620, this property will display 620. |
State | Get | Connection state. The supported states are: - [System.Data.ConnectionState] - Closed - Open - Connecting |
Caution
This example or guidance references sensitive information, such as a connection string or a username and password. Never hardcode these values in your code, and make sure that you protect confidential data by using the most secure authentication available. For more information, see the following documentation:
Supported Methods
Name | Description |
---|---|
ChangeDatabase(string) | Not supported. |
Close() | Closes the connection to the SAP system. |
CreateCommand() | Returns a new SAPCommand associated with this connection. |
GetSchema() | Gets the list of discovered SAP tables. All discovered tables are available in an XML file SAPDiscoveredObjects.xml. The file is located at <installation drive>:\Program Files\Common Files\Microsoft Shared\Adapters\SAP. |
GetSchema(string) | Gets schema based on collection name. Supports the collection name “Tables”. |
Name | Description |
---|---|
GetSchema(string, string[]) | Gets schema based on the collection name and restrictions. The table below represents the collection names and restrictions supported: |
Name | Collection Name | Restrictions | Description |
---|---|---|---|
GetSchema(string, string[]) | Tables | - | List of discovered SAP Tables |
GetSchema(string, string[]) | Procedures | - | List of discovered RFCs |
GetSchema(string, string[]) | SearchRFCs | arr[0]: Search expr | List of matching RFCs |
GetSchema(string, string[]) | ImportParameters | arr[1]: RFC name | Import parameters of RFC |
GetSchema(string, string[]) | ImportParameterColumn | arr[1]: RFC name arr[2]: Param name |
Import parameter schema |
GetSchema(string, string[]) | ExportParameters | arr[1]: RFC name | Export parameters of RFC |
GetSchema(string, string[]) | ExportParameterColumn | arr[1]: RFC name arr[2]: Param name |
Export parameter schema |
GetSchema(string, string[]) | TableParameters | arr[1]: RFC name | Table parameters of RFC |
GetSchema(string, string[]) | TableParameterColumn | arr[1]: RFC name arr[2]: Param name |
Table parameter schema |
GetSchema(string, string[]) | ChangingParameters | arr[1]: RFC name | Changing parameters of RFC |
GetSchema(string, string[]) | ChangingParameterColumn | arr[1]: RFC name arr[2]: Param name |
Changing parameter schema |
GetSchema(string, string[]) | columns | arr[1]: Table name | SAP Table column schema |
Name | Description |
---|---|
Open() | Opens an SAP connection based on the connection string. |
Note
Except for Table, Procedure, and SearchRFCs collection entries, for all other collection entries you must specify a dummy value for arr[0].
Supported Constructors
Name | Description |
---|---|
SAPConnection() | Creates an SAPConnection object instance. |
SAPConnection(string) | Accepts an SAP connection string. Throws an exception if the connection string is invalid. |