dotConnect for Dynamics 365 Documentation
Devart.Data.Dynamics Namespace / DynamicsConnection Class / DynamicsConnection Constructor / DynamicsConnection Constructor(String)
The connection used to connect to Dynamics CRM.
Example

In This Topic
    DynamicsConnection Constructor(String)
    In This Topic
    Initializes a new instance of the DynamicsConnection class when given a string containing the connection string.
    Syntax
    'Declaration
     
    Public Function New( _
       ByVal connectionString As String _
    )
    public DynamicsConnection( 
       string connectionString
    )

    Parameters

    connectionString
    The connection used to connect to Dynamics CRM.
    Remarks
    When a new instance of DynamicsConnection is created, the read/write properties are set to the following initial values unless they are specifically set using their associated keywords in the ConnectionString property.
    Example
    The following example creates and opens a DynamicsConnection.
    public void CreateDynamicsConnection()
    {
      string myConnString = 
          "Server=https://your_company.crm4.dynamics.com;User [email protected];Password=A123456789;";
      DynamicsConnection dynamicsConnection = new DynamicsConnection(myConnString);
      dynamicsConnection.Open();
      //Do something
      dynamicsConnection.Close();
    }
    Public Sub CreateDynamicsConnection()
      Dim myConnString As String = _
          "Server=https://your_company.crm4.dynamics.com;User [email protected];Password=A123456789;"
      Dim dynamicsConnection As New DynamicsConnection(myConnString)
      dynamicsConnection.Open()
      'Do something
      dynamicsConnection.Close()
    End Sub
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also