Connect C# to Zoho CRM in .NET via ADO.NET
Database connectivity is fundamental for application development, as applications rely on secure and reliable access to data. A common challenge developers face is simplifying the connection between applications and data sources for data retrieval and manipulation. One effective solution is the dotConnect product line by Devart, which offers powerful data providers for all popular data sources, including relational databases and cloud platforms.
In this article, we'll explore how to establish a secure connection and retrieve or modify Zoho CRM data in a C# application using dotConnect for Zoho CRM.
Why dotConnect for Zoho CRM?
dotConnect for Zoho CRM is an ADO.NET data provider that enables a direct connection to Zoho CRM, allowing developers to access, retrieve, and manipulate data effortlessly. The integration of Zoho CRM data into applications becomes much easier without the need for mastering its specifics.
The provider is fully ADO.NET-compliant, compatible with various .NET platforms, and integrates flawlessly with Visual Studio.
Prerequisites
Before starting, ensure you have the following prerequisites in place:
- Visual Studio: The IDE we use. You can download the free Community Edition from the official website.
- dotConnect for Zoho CRM: A high-performance data provider for Zoho CRM that we'll use to establish a connection to the data source.
- Zoho CRM credentials: The connection details necessary to sign in to your Zoho CRM account.
Download and activate dotConnect for Salesforce
30-day free trial version
Download and install dotConnect for Salesforce directly on your machine, or install the Devart.Data.Salesforce NuGet package.
No license key is required, and you can start exploring the product immediately.
Full version
After purchasing the full version, go to your profile's Licenses page. Choose your product and click Details. Here, you'll find the license details and the Activation Key.
To activate a connection in your application, add the License Key to your connection string.
Create a project and install the NuGet package
First of all, we need to set up a new C# project. Open Visual Studio and create a new project. Search for Console App (.NET Core/.NET Framework), select it, and click Next.

Give this project a name (we have created a demo project called Zoho CRMIntegrationApp), check other details, and click Create.
The next step is to install dotConnect for Zoho CRM via the NuGet Package Manager in Visual Studio. Click Tools > NuGet Package Manager > Manage NuGet Packages for Solution.

In the NuGet Package Manager section, click Browse and search for Devart.Data.Zoho. After locating it, click Install.

Get Zoho CRM tokens
You need the OAuth tokens to authenticate and connect to Zoho CRM. For detailed information, we recommend you refer to the Zoho CRM official documentation.
To interact with the Zoho API, you need to obtain a token that grants access to the Client service. Go to the Zoho API Console and sign in with your Zoho account credentials.
Click Add Client and choose Self Client.
Fill in the required details: Scope and Scope Description. In our test case, the Scope is: ZohoCRM.settings.ALL,ZohoCRM.modules.ALL, and Scope Description can be any.

Click Create to get the code.

Enter the generated code into the respective field of the Zoho Console and click Send. The Refresh Token will be generated automatically.

Establish a connection
This tutorial provides sample code needed to set up and connect to Zoho CRM so you can rely on it and also modify it according to your needs.
We need the following credentials for that code:
- Domain
- API Version
- Client Id
- Client Secret
- Refresh token
- License key
The sample code for connection is below, make sure to replace the placeholders with your valid Zoho CRM credentials:
string domain = "crm.zoho.com"; string clientId = "**********"; string clientSecret = "**********"; string refreshToken = "**********"; string licenseKey = "**********"; string connectionString = $"Domain={domain};API Version=v2;Client Id={clientId};Client Secret={clientSecret};Refresh Token={refreshToken};License Key={licenseKey}";

Visual Studio has successfully connected to the Zoho CRM account.

Therefore, you have connected your C# application to Zoho CRM using the dotConnect for Zoho CRM. From here, you can expand your application to perform various operations, such as querying customers, invoices, and accounts, writing and updating Zoho CRM data programmatically, and so on.
Visit the Devart Documentation and Zoho CRM API resources for details on additional features.
Conclusion
dotConnect for Zoho CRM simplifies the lives of application developers when they need to connect to the data source and manage data safely and efficiently from the application. With dotConnect, developers can avoid the complexities of manual configurations, advanced APIs, and additional resources as it offers a simple direct connection to Zoho CRM using the familiar ADO.NET classes.
Experience the full capabilities of dotConnect for Zoho CRM with Devart's fully functional 30-day free trial — test it under full load and see the difference!