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
    See Also