Getting Started With dotConnect for Zoho Desk

Below are some resources to help you maximize your experience with dotConnect for Zoho Desk.

dotConnect for Zoho Desk is a high-performance ADO.NET data provider with ORM support, offering fast and encrypted access to Zoho Desk 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.ZohoDesk;

namespace ZohoDeskConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = "" +
    "Authentication Type=OAuthInteractive;" +
    "DataCenter=US;" +
    "License key=**********";

            try
            {
                using (ZohoDeskConnection connection = new ZohoDeskConnection(connectionString))
                {
                    connection.Open();
                    Console.WriteLine("Connection successful.");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred: " + ex.Message);
            }
        }

    }
}
PM> Install-Package Devart.Data.ZohoDesk
using Devart.Data.ZohoDesk;

namespace ZohoDeskConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string domain = "YOUR_DOMAIN";
            string clientId = "YOUR_CLIENT_ID";
            string clientSecret = "YOUR_CLIENT_SECRET";

            string connectionString = "Authentication Type=OAuthInteractive;DataCenter=US;" +
                                      $"Domain={domain};" +
                                      $"Client Id={clientId};" +
                                      $"Client Secret={clientSecret};" +
                                      "License key=**********";

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

namespace ZohoDeskConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = "Authentication Type=OAuthInteractive;DataCenter=US;License key=**********";

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

                    string sql = "SELECT LastName, FirstName, Email, Phone FROM Contacts";

                    using (ZohoDeskCommand command = new ZohoDeskCommand(sql, connection))
                    using (ZohoDeskDataAdapter adapter = new ZohoDeskDataAdapter(command))
                    {
                        DataTable accountsTable = new DataTable();
                        adapter.Fill(accountsTable);

                        foreach (DataRow row in accountsTable.Rows)
                        {
                            string lastName = row.Field<string?>("LastName") ?? string.Empty;
                            string firstName = row.Field<string?>("FirstName") ?? string.Empty;
                            string email = row.Field<string?>("Email") ?? string.Empty;
                            string phone = row.Field<string?>("Phone") ?? string.Empty;

                            Console.WriteLine($"Name: {firstName} {lastName} | Email: {email} | Phone: {phone}");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred: " + ex.Message);
            }
        }
    }
}
PM> Install-Package Devart.Data.ZohoDesk
using System;
using System.Linq;

namespace ZohoDeskEFCore
{
    class Program
    {
        static void DisplayContacts()
        {
            using (var context = new ZohoModel())
            {
                var contacts = context.contacts
                    .Select(a => new { a.firstName, a.lastName, a.Phone, a.Email })
                    .ToList();

                foreach (var contact in contacts)
                {
                    Console.WriteLine($"Name: {contact.firstName} {contact.lastName}");
                    Console.WriteLine($"Phone: {contact.Phone}");
                    Console.WriteLine($"Email: {contact.Email}");
                    Console.WriteLine(new string('-', 20));
                }
            }
        }
    }
}
PM> Install-Package Devart.Data.ZohoDesk.EFCore
using System;
using System.Data;
using Devart.Data.ZohoDesk;

namespace ZohoDeskConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = "Authentication Type=OAuthInteractive;DataCenter=US;License key=**********";

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

                    Console.WriteLine("\nInserting a sample Contact via ZohoDeskCommand...");
                    string insertSql = @"INSERT INTO Contacts
                        (FirstName, LastName)
                        VALUES (@FirstName, @LastName)";

                    using (ZohoDeskCommand insertCmd = new ZohoDeskCommand(insertSql, connection))
                    {
                        insertCmd.Parameters.AddWithValue("FirstName", "Example");
                        insertCmd.Parameters.AddWithValue("LastName", "Contact via Command");

                        int affected = insertCmd.ExecuteNonQuery();
                        Console.WriteLine($"Insert complete. Rows affected: {affected}\n");
                    }

                    Console.WriteLine("Retrieving contacts (FirstName, LastName, Phone, Email)...");
                    string selectSql = "SELECT FirstName, LastName, Phone, Email FROM Contacts";

                    using (ZohoDeskCommand selectCmd = new ZohoDeskCommand(selectSql, connection))
                    using (ZohoDeskDataAdapter adapter = new ZohoDeskDataAdapter(selectCmd))
                    {
                        DataTable contactsTable = new DataTable();
                        adapter.Fill(contactsTable);

                        foreach (DataRow row in contactsTable.Rows)
                        {
                            string firstName = row.Field<string?>("FirstName") ?? string.Empty;
                            string lastName = row.Field<string?>("LastName") ?? string.Empty;
                            string phone = row.Field<string?>("Phone") ?? string.Empty;
                            string email = row.Field<string?>("Email") ?? string.Empty;

                            Console.WriteLine($"Name: {firstName} {lastName} | Email: {email} | Phone: {phone}");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred: " + ex.Message);
            }
        }
    }
}

PM> Install-Package Devart.Data.ZohoDesk
using System.Data;
using Devart.Data.ZohoDesk;

namespace ZohoDeskConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = "Authentication Type=OAuthInteractive;DataCenter=US;License key=**********";

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

                    // Example: UPDATE with parameters
                    ZohoDeskCommand cmd = connection.CreateCommand();
                    cmd.CommandText = "UPDATE Contacts SET Phone = :phone WHERE FirstName = :name";
                    cmd.Parameters.Add("phone", DbType.String).Value = "1 888 900 9999";
                    cmd.Parameters.Add("name", DbType.String).Value = "Example";

                    int affected = cmd.ExecuteNonQuery();
                    Console.WriteLine($"Updated {affected} row(s).");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred: " + ex.Message);
            }
        }
    }
}
PM> Install-Package Devart.Data.ZohoDesk
using System.Data;
using Devart.Data.ZohoDesk;

namespace ZohoDeskConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = "Authentication Type=OAuthInteractive;DataCenter=US;License key=**********";

            try
            {
                ExecuteUpdate(connectionString);
            }
            catch (Exception ex)
            {
                Console.WriteLine("An unexpected error occurred: " + ex.Message);
                Console.WriteLine(ex.ToString());
            }
        }

        static void ExecuteUpdate(string connectionString)
        {
            using (var myConnection = new ZohoDeskConnection(connectionString))
            using (var myCommand = new ZohoDeskCommand(
                "UPDATE Contacts SET Phone = '1 888 900 1111' WHERE FirstName = 'Example'", myConnection))
            {
                try
                {
                    myConnection.Open();
                    Console.WriteLine("Connection opened. Executing update...");

                    int rowsAffected = myCommand.ExecuteNonQuery();
                    Console.WriteLine("Operation complete. Rows Affected: " + rowsAffected);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error during execution: " + ex.Message);
                    Console.WriteLine(ex.ToString());
                }
                finally
                {
                    if (myConnection.State != ConnectionState.Closed)
                        myConnection.Close();
                }
            }
        }
    }
}
PM> Install-Package Devart.Data.ZohoDesk

Documentation

Licensing
Licensing
A detailed technical reference on embedding license information—a required resource for applications built with dotConnect for Zoho Desk.
DataAdapter Features
DataAdapter features
A guide to using the ZohoDataAdapter class for interacting with Zoho Desk 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 Zoho Desk?
dotConnect for Zoho Desk 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 Zoho Desk 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 necessary. 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.ZohoDesk.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 to use them in your solution only.

There's no need for a full installation on the target machine, you can also use the "Minimal installation" option provided by the setup. It does not disturb any other dotConnect components.

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\...\Community\Common7\IDE\Extensions\Devart
  • C:\Program Files\Microsoft Visual Studio\...\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

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

Try the 30-day trial of the full product. No limits. No card required Start free trial