dotConnect for Salesforce Documentation
Devart.Data.Salesforce Namespace / SalesforceConnection Class / ConnectionString Property
Example

In This Topic
    ConnectionString Property (SalesforceConnection)
    In This Topic
    Gets or sets the string used to open Salesforce.com or Database.com connection.
    Syntax
    'Declaration
     
    Public Overrides Property ConnectionString As String
    public override string ConnectionString {get; set;}

    Property Value

    The connection string that includes the parameters needed to establish the initial connection. The default value is an empty string ("").
    Remarks
    When ConnectionString property is assigned a value, connection closes. Many of the connection string values have corresponding properties. When the connection string is set, all of these properties are updated, except when an error is detected. In this case, none of the properties are updated. SalesforceConnection properties return only those settings contained in the ConnectionString.

    Resetting the ConnectionString on a closed connection resets all connection string values (and related properties) including the password. For example, if you set a connection string that includes "User Id=test", and then reset the connection string to "Data Source=localhost", the UserId property is no longer set to test.

    The connection string is parsed immediately after being set. If errors in syntax are found when parsing, a runtime exception, such as System.ArgumentException, is generated. Other errors can be found only when an attempt is made to Open the connection.

    The ConnectionString is similar to an OLE DB connection string. Values may be delimited by single or double quotes, (for example, name='value' or name="value"). Either single or double quotes may be used within a connection string by using the other delimiter, for example, name="value's" or name= 'value"s', but not name= 'value's' or name= ""value"". All blank characters, except those placed within a value or within quotes, are ignored. Keyword value pairs must be separated by a semicolon (;). If a semicolon is part of a value, it also must be delimited by quotes. No escape sequences are supported. The value type is irrelevant. Names are not case sensitive. Arguments names may occur only once in the connection string.

    The following table lists the valid names for values within the ConnectionString.

    Name Description
    Authentication Type Determines the authentication method to use when connecting to Salesforce.
    Batch Size Determines the the number of records returned by a service at once. The default value is 500; the minimum is 200, and the maximum is 2,000.
    Cache All Allows you to create cache for all the tables when connecting. Data is actually cached only when it is queried.
    Client ID Specifies the Consumer Key from the connected app definition. The value is used for the OAuth Refresh Token authentication.
    Client Secret Specifies the Consumer Secret from the connected app definition. The value is used for the OAuth Refresh Token authentication.
    Connection Lifetime Determines the maximum time span (in seconds) a connection can remain in the pool: when a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span exceeds the value specified by Connection Lifetime. The default value is 0 (connection always returns to pool).
    Connect Timeout -or- Connection Timeout Specifies the length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error. The default value is 60.
    Data Cache Specifies the path to the data cache database file.
    Default Refresh Interval Determines the default value of the interval in seconds between data cache refreshing. The default value is 3600 (one hour).
    Deferred Login Determines whether to delay establishing an actual connection to Salesforce until some data that is not present in the local cache is queried or data is modified.
    Failover Retries Specifies the maximum number of retry attempts to reconnect after a failover event.
    Host Specifies the Salesforce.com or Database.com login URL.
    Ignore Blank Values Specifies whether blank values are ignored when updating records in Salesforce.
    Include Deleted Determines whether to include the deleted records (from Salesforce recycled bin) to SELECT query results.
    Initialization Command Specifies a database-specific command that should be executed immediately after establishing the connection.
    Local SQL Engine Uses a local SQL engine to process queries instead of a remote server.
    Max Pool Size Specifies the maximum number of connections allowed in the pool. Setting the Max Pool Size value of the ConnectionString can affect performance. The default value is 100.
    Metadata Cache Specifies the path to the metadata cache database file.
    Min Pool Size Specifies the minimum number of connections allowed in the pool. The default value is 0.
    NormalizeDbNames Determines whether database object names are normalized when retrieved from the database.
    Organization ID Specifies a unique identifier for the Salesforce organization to which the account you connect to belongs.
    Password Specifies the password for the account.
    Persist Security Info Indicates if security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state.
    Pooling Determines whether, by default, the SalesforceConnection object is drawn from the appropriate pool or is created and added to the appropriate pool, when set to true.
    Preserve Names Specifies whether Salesforce object and field names are preserved when retrieving metadata.
    Proxy Host Specifies the host name or IP address of proxy server.
    Proxy Password Specifies the password for the proxy server account.
    Proxy Port Specifies the port number of the proxy server. The default value is 3128.
    Proxy User Specifies the proxy server account name.
    Readonly Determines whether the connection is read-only (allows only SELECT statements).
    Refresh Metadata Determines whether to refresh Salesforce metadata each time when the connection is opened.
    Refresh Token Specifies the Salesforce OAuth 2.0 refresh token. The value is used for the OAuth Refresh Token authentication.
    Run Once Command Specifies a command to execute the first time the connection is opened. The command is not executed when the connection is retrieved from the connection pool.
    Security Token Specifies the automatically generated key used for logging in to Salesforce from an untrusted network.
    Session ID Specifies the Salesforce session identificator used for the session ID authorization.
    System Objects Specifies whether the system fields of the Salesforce objects should be accessible. The default value is false.
    Token Server Specifies the location where OAuth 2.0 refresh tokens are stored between sessions. The location can be a file on disk or a registry key.
    Trigger Auto Response Email Specifies whether to trigger auto-response rules or not. The default value is false.
    Trigger Other Email Specifies whether to trigger email outside the organization or not. The default value is false.
    Trigger User Email Specifies whether to trigger email that is sent to users in the organization or not. The default value is false.
    Update Mru Specifies whether to update the list of most recently used items or not.
    Upgrade Cache Determines whether to upgrade the local cache database or to throw an exception in case when dotConnect for Salesforce version that uses a newer cache structure or newer version of Salesforce API discovers an old incompatible cache for the connection that is opening.
    Use Assignment Rules Determines whether to use assignment rules when inserting or updating data. The default value is false.
    User ID -or- User Specifies the Salesforce login account.
    UTC Dates Indicates whether all the datetime values retrieved from Salesforce are returned as UTC values or converted to local time, and whether date values, specified on the application side (for example, in SQL statements) are considered UTC or local. The default value is false.
    Example
    The following example creates a SalesforceConnection and sets some of its properties in the connection string.
    public void CreateSalesforceConnection()
    {
      string myConnString1 = 
         "Server=login.salesforce.com;User Id= [email protected];Password=mypassword;Security Token=qweASDzcx1234567890rtyui;";
      SalesforceConnection salesforceConnection1 = new SalesforceConnection(myConnString1);
      salesforceConnection1.Open();
    }
    Public Sub CreateSalesforceConnection()
      Dim myConnString1 As String = _
          "Server=login.salesforce.com;User Id= [email protected];Password=mypassword;Security Token=qweASDzcx1234567890rtyui;"
      Dim salesforceConnection1 As New SalesforceConnection(myConnString1)
      salesforceConnection1.Open()
    End Sub
    See Also