Save Big on Cyber Monday! Up to 40% Off
ends in   {{days}}
Days
{{timeFormat.hours}}
:
{{timeFormat.minutes}}
:
{{timeFormat.seconds}}

Getting Started With dotConnect for Dynamics 365

Below are some resources to help you maximize your experience with dotConnect for Dynamics 365.

dotConnect for Dynamics 365 is a high-performance ADO.NET data provider with ORM support, offering fast and encrypted access to Microsoft Dynamics 365 data for application development.

  • EF Core, Dapper, NHibernate ORM support
  • Local SQL engine with support for SQL-92
  • Broad compatibility with various .NET platforms and versions
  • Full compliance with ADO.NET
  • Integration with Visual Studio

Code examples

using Devart.Data.Dynamics;

class Program
{
    static void Main(string[] args)
    {
        string connectionString = "Authentication Type=RefreshTokenInteractive;" +
        "License Key=**********";

        using (DynamicsConnection connection = new DynamicsConnection(connectionString))
        {
            try
            {
                connection.Open();
                Console.WriteLine("Connection successful!");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"An error occurred: {ex.Message}");
            }
        }
    }
}
PM> Install-Package Devart.Data.Dynamics
using Devart.Data.Dynamics;

class Program
{
    static void Main(string[] args)
    {
        string connectionString =
            "Authentication Type=RefreshTokenInteractive;" +
            "Server=YOUR_ORG.crm.dynamics.com;" +
            "User [email protected];" +
            "Client Id=YOUR_APP_CLIENT_ID;" +
            "Client Secret=YOUR_APP_CLIENT_SECRET;" +
            "License Key=**********";


        using (DynamicsConnection connection = new DynamicsConnection(connectionString))
        {
            try
            {
                connection.Open();
                Console.WriteLine("Connection successful!");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"An error occurred: {ex.Message}");
            }
        }
    }
}
PM> Install-Package Devart.Data.Dynamics
using Devart.Data.Dynamics;

class Program
{
    static void Main(string[] args)
    {
        string connectionString = "Authentication Type=RefreshTokenInteractive;" +
        "License Key=**********";

        using (DynamicsConnection connection = new DynamicsConnection(connectionString))
        {
            try
            {
                connection.Open();
                Console.WriteLine("Connection successful!");

                DynamicsCommand command = new DynamicsCommand("SELECT roleid, name, createdon FROM role", connection);

                using (DynamicsDataReader reader = command.ExecuteReader())
                {
                    int rowCount = 0;
                    const int maxRows = 8;

                    while (reader.Read() && rowCount < maxRows)
                    {
                        Console.WriteLine($"Role ID: {reader["roleid"]},\nName: {reader["name"]},\nCreated On: {reader["createdon"]}\n");
                        rowCount++;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine($"An error occurred: {ex.Message}");
            }
        }
    }
}
PM> Install-Package Devart.Data.Dynamics
using System;
using System.Linq;

namespace DynamicsEFCore
{
  class Program
  {
    static void Main(string[] args)
    {
      using (var context = new Model())
      {
        var contacts = context.Contacts
          .Take(10)
          .ToList();

        foreach (var contact in contacts)
        {
          Console.WriteLine($"Name: {contact.Firstname} {contact.Lastname}, Phone: {contact.Mobilephone}");
        }
      }
    }
  }
}
PM> Install-Package Devart.Data.Dynamics.EFCore
using System.Data;
using Devart.Data.Dynamics;

class Program
{
    static void Main(string[] args)
    {
        string connectionString = "Authentication Type=RefreshTokenInteractive;" +
        "License Key=**********";

        using (DynamicsConnection connection = new DynamicsConnection(connectionString))
        {
            try
            {
                connection.Open();
                Console.WriteLine("Connection successful!");

                string selectSql = "SELECT roleid, name, createdon FROM role";
                DynamicsDataAdapter adapter = new DynamicsDataAdapter(selectSql, connection);
                DataTable rolesTable = new DataTable();
                adapter.Fill(rolesTable);

                int rowCount = 0;
                const int maxRows = 8;
                foreach (DataRow row in rolesTable.Rows)
                {
                    if (rowCount >= maxRows)
                        break;

                    Console.WriteLine($"Role ID: {row["roleid"]},\nName: {row["name"]},\nCreated On: {row["createdon"]}\n");
                    rowCount++;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine($"An error occurred: {ex.Message}");
            }
        }
    }
}
PM > Install-Package Devart.Data.Dynamics

How-to articles

.NET Connection String for Dynamics 365
Learn how to set up connection strings properly when working with dotConnect for Dynamics 365 in .NET applications.
Connect to Dynamics 365 in .NET
Explore how to establish a connection between .NET applications and Dynamics 365 using ADO.NET.
Connect to Dynamics 365 with EF Core
Find out how to connect Dynamics 365 to your application using EF Core and ADO.NET.
Connect to Dynamics 365 in MAUI
See how to build .NET MAUI applications and perform CRUD operations with Dynamics 365 using ADO.NET.

Documentation

Licensing
Licensing
A detailed technical reference on embedding license information - a required resource for applications built with dotConnect for Dynamics 365.
DataAdapter features
DataAdapter features
A guide to using the DynamicsDataAdapter class for interacting with Dynamics 365 data in a disconnected architecture.
Parameters
Parameters
An overview of SQL query parameters and their synchronization, along with practical insights into working with stored procedures.
SQL translation
SQL translation
An introduction to using translatable SQL for query performance optimization through remote execution instead of client-side processing.

dotConnect Universal

Get universal access to data from a variety of sources, including SQL Server, Oracle, PostgreSQL, MySQL, SQLite, DB2, InterBase, Microsoft Access, and Firebird. Other servers can be accessed through their ADO.NET, OLE DB and ODBC providers.

FAQ

What is the trial period for dotConnect for Dynamics 365?
dotConnect for Dynamics 365 offers a fully functional 30-day trial. During this period, you can use and evaluate all features without limitations. After the trial ends, you can purchase a license to keep using the product.
Why do I need to install the product if NuGet is available?

dotConnect for Dynamics 365 provides two sets of assemblies, and the choice depends on your project type:

  • For .NET (.NET Core/.NET 5+) projects: Use the assemblies available via NuGet packages.
  • For .NET Framework projects: Use the Devart assemblies included with the product installer.
Where should I apply my License Key?

The method for applying your license depends on your project type:

  • For .NET (.NET Core/.NET 5+) projects, apply the License Key at runtime using the License Key connection string parameter.
  • For .NET Framework projects, no license key is needed. Simply download and install the licensed version of dotConnect from your Devart Customer Portal.
Do end users of my application need a Devart license, or do I have to pay additional fees for deploying my software?

No, end users do not need a Devart license, and there are no additional deployment fees, as long as you hold a valid Devart license.

According to the EULA, you're allowed to redistribute the following runtime assemblies with your application:

  • Devart.Data.Dynamics.dll
  • Devart.Data.SqlShim.dll
  • Devart.Data.dll

You can include them in your app's folder (such as Bin for web apps) or register them in the GAC. Just make sure they are only used by your solution.

There's no need for a full installation on the target machine, you can also use the "Minimal installation" option provided by the setup.

No other components of dotConnect may be distributed.

How can I update dotConnect to a new version?

To update dotConnect to a new version, you need to reinstall it:

  1. Open Settings > Apps > Installed apps in Windows.
  2. Uninstall the current and any older versions of dotConnect, including Entity Developer and LinqConnect, if installed.
  3. Visit the Customer Portal and download the latest licensed version.
  4. Install the downloaded version and receive the latest features and improvements.
How can I completely remove all previous versions of a product?
  1. Go to Settings > Apps > Installed apps and uninstall:
    • All dotConnect providers
    • Entity Developer
    • LinqConnect
  2. Manually delete any leftover files from the following locations (if they exist):

    GAC folders:

    • C:\Windows\assembly\GAC_MSIL
    • C:\Windows\Microsoft.NET\assembly\GAC_MSIL

    Program files and extensions:

    • C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Devart
    • C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Devart
    • C:\Program Files (x86)\Devart
    • C:\Program Files\Devart
    • C:\Program Files (x86)\Common Files\Devart
    • C:\Program Files\Common Files\Devart

    Program data folders:

    • C:\ProgramData\Devart\dotConnect
    • C:\ProgramData\Devart\Entity Developer
    • C:\ProgramData\Devart\EntityDeveloper

Removing these ensures a clean system and prevents conflicts during future installations.

dotConnect for Dynamics 365

Get an enhanced ORM-enabled data provider for Dynamics 365 and develop .NET applications working with Dynamics 365 data quickly and easily!

Discover the ultimate capabilities of dotConnect for Dynamics 365 Download free trial