dotConnect for Dynamics 365 Documentation
Devart.Data.Dynamics Namespace / DynamicsConnection Class / DynamicsConnection Constructor / DynamicsConnection Constructor()
Example

In This Topic
    DynamicsConnection Constructor()
    In This Topic
    Initializes a new instance of the DynamicsConnection class.
    Syntax
    'Declaration
     
    Public Function New()
    public DynamicsConnection()
    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()
    {
      DynamicsConnection dynamicsConnection = new DynamicsConnection();
      dynamicsConnection.ConnectionString = 
          "Server=https://your_company.crm4.dynamics.com;User [email protected];Password=A123456789;";
      dynamicsConnection.Open();
      //Do something
      dynamicsConnection.Close();
    }
    Public Sub CreateDynamicsConnection()
      Dim dynamicsConnection As New DynamicsConnection()
      dynamicsConnection.ConnectionString = _ 
          "Server=https://your_company.crm4.dynamics.com;User [email protected];Password=A123456789;"
      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