DataConnector
接続の作成
ADO.NET provider for Salesforce > 接続の作成

To establish a connection to a Salesforce data source, the ADO.NET Provider can be used through the C1SalesforceConnection class. This class requires a connection string to be provided as an argument, which can be created in either of the following ways:

The following code shows how to use the C1SalesforceConnectionStringBuilder class to configure the connection string for Salesforce, which can then be consumed by the C1SalesforceConnection class to establish a connection to Salesforce server. Through that connection, the data source can be queried.

CS
コードのコピー
//Salesforce サービスの URL。
const string GCSalesforceServerConnectionString = @"Username=**********;Password=***********;Security Token=************;
                                                OAuth Client Id=***********; 
                                                OAuth Client Secret=***************; 
                                                OAuth Token Endpoint=https://ap16.salesforce.com/services/oauth2/token; 
                                                Url=https://ap16.salesforce.com/services/data/v45.0";
// 接続文字列を設定します。            
C1SalesforceConnectionStringBuilder builder = new C1SalesforceConnectionStringBuilder();
builder.ConnectionString = $@"{GCSalesforceServerConnectionString}";

//接続を設定します。
C1SalesforceConnection con = new C1SalesforceConnection(builder.ConnectionString);

In Salesforce, the ApiVersion property in the connection string specifies the API version of Salesforce to be used. There are two ways to specify the ApiVersion:

Note: The properties of C1SalesforceConnectionStringBuilder can be used to setup the connection keys when passed as connection strings. The connection key will be the corresponding property with added space character. For example, "UseCache" will be used as "Use Cache".