This guide will show you how to connect a .NET MAUI application to Zoho CRM using dotConnect for Zoho CRM,
a high-performance ADO.NET provider by Devart. You'll learn how to set up OAuth authentication, create a connection, and perform basic data operations like reading, inserting, and
deleting Zoho CRM records—all using standard ADO.NET classes.
Why dotConnect for Zoho CRM?
Quick and easy integration
dotConnect enables straightforward connectivity between .NET applications and Zoho CRM, allowing developers to access CRM modules and records without working directly with Zoho's REST APIs.
User-friendly classes
Using familiar ADO.NET components, dotConnect for Zoho CRM allows developers to work with data through standard .NET data access patterns such as connections, commands, and data readers.
Advanced ORM support
dotConnect works with EF Core, Dapper, NHibernate, and LinqConnect, enabling flexible object-relational mapping and efficient interaction with Zoho CRM data in .NET applications.
Interactive OAuth token generation
Access to Zoho CRM is authorized through a browser-based login flow. After successful authentication, dotConnect automatically retrieves and manages access and refresh tokens for secure connections.
Full compliance with ADO.NET
Devart implements the standard ADO.NET provider model in dotConnect solutions, ensuring consistent behavior and compatibility with existing .NET frameworks and development tools.
Priority support & frequent updates
Devart provides professional technical assistance, comprehensive documentation, and ongoing product enhancements, helping developers maintain stable and reliable integrations with Zoho CRM.
Download and activate dotConnect for Zoho CRM
You can start using dotConnect for Zoho CRM immediately with a 30-day free trial. Choose one of the following installation options:
The CheckConnection method checks whether a connection to Zoho CRM can be established and informs the user of the result.
The LoadAccounts method retrieves account data from Zoho CRM and populates ObservableCollection < Account >.
Set up the main page
To add the button that tests the connection and displays the data, open MainPage.xaml and paste the following code.
Grid Layout: Grid inside DataTemplate is configured with four columns. Each of them takes an equal share of the width. This creates a table-like layout with four columns.
Data Binding: Each Label in Grid is bound to a property of the Account class and displays the data in the respective columns.
Connection Status: ConnectionStatusLabel displays the connection status in green if the connection is successful.
Once you have connected your application to Zoho CRM, you can fetch and manage your data.
Insert new data
To add functionality for creating a new account and refreshing the table, add a button to your UI and implement the logic to insert a new account into the Zoho CRM database.
After adding the account, display an alert to inform the user of the status, then refresh the data to update the table.
1. In MainPage.xaml, paste this code after ListView to include the button for adding a new account.
using Devart.Data.Zoho;
using System.Collections.ObjectModel;
namespaceZohoMAUI
{
publicpartialclassMainPage : ContentPage
{
public ObservableCollection<Account> Accounts
{
get;
set;
}
publicMainPage()
{
InitializeComponent();
Accounts = new ObservableCollection<Account>();
AccountsListView.ItemsSource = Accounts;
InitializeDataAsync();
}
privateasyncvoidInitializeDataAsync()
{
if (await CheckConnection())
{
LoadAccounts();
}
}
privateasync Task<bool> CheckConnection()
{
try
{
using (var connection = new ZohoConnection(AppConfig.ConnectionString))
{
await Task.Run(() => connection.Open());
ConnectionStatusLabel.Text = "Successful connection";
returntrue;
}
}
catch (Exception ex)
{
await DisplayAlert("Connection Error", $"Failed to connect: {ex.Message}", "OK");
returnfalse;
}
}
privateasyncvoidOnAddAccountClicked(object sender, EventArgs e)
{
try
{
using (var connection = new ZohoConnection(AppConfig.ConnectionString))
{
connection.Open();
var command = new ZohoCommand(
"INSERT INTO Accounts (\"Account Name\", Phone, Website, \"Account Type\") " +
"VALUES (:Account_Name, :Phone, :Website, :Account_Type)", connection);
// Add parameters for the test data
command.Parameters.Add(new ZohoParameter { ParameterName = ":Account_Name", Value = "Test Account" });
command.Parameters.Add(new ZohoParameter { ParameterName = ":Phone", Value = "123-456-7890" });
command.Parameters.Add(new ZohoParameter { ParameterName = ":Website", Value = "http://testaccount.com" });
command.Parameters.Add(new ZohoParameter { ParameterName = ":Account_Type", Value = "Test Type" });
int rowsAffected = command.ExecuteNonQuery();
if (rowsAffected > 0)
{
await DisplayAlert("Success", "Account added successfully!", "OK");
await LoadAccounts();
}
else
{
await DisplayAlert("Error", "No rows were affected.", "OK");
}
}
}
catch (Exception ex)
{
await DisplayAlert("Error", $"Failed to add account: {ex.Message}", "OK");
}
}
privateasync Task LoadAccounts()
{
try
{
using (var connection = new ZohoConnection(AppConfig.ConnectionString))
{
connection.Open();
var command = new ZohoCommand("SELECT \"Account Name\", Phone, Website, \"Account Type\" FROM Accounts", connection);
var reader = command.ExecuteReader();
await MainThread.InvokeOnMainThreadAsync(() => Accounts.Clear());
while (reader.Read() && Accounts.Count < 10)
{
var account = new Account
{
Account_Name = reader["Account Name"].ToString(),
Phone = reader["Phone"].ToString(),
Website = reader["Website"].ToString(),
Account_Type = reader["Account Type"].ToString()
};
await MainThread.InvokeOnMainThreadAsync(() => Accounts.Add(account));
}
}
}
catch (Exception ex)
{
await DisplayAlert("Error", ex.Message, "OK");
}
}
}
publicclassAccount
{
publicstring Account_Name
{
get;
set;
}
publicstring Phone
{
get;
set;
}
publicstring Website
{
get;
set;
}
publicstring Account_Type
{
get;
set;
}
}
}
The OnAddAccountClicked method is called when the Add Test Account button is clicked. It inserts a new account into the Zoho CRM database using test data.
ZohoCommand is an SQL command for inserting a new account that utilizes parameters to specify the values. The parameter names correspond to the field names in the database.
Alert and Refresh: After adding the account, an alert is displayed to inform the user, and the LoadAccounts method is called to refresh the data in the table.
This setup allows users to add a new test account and see the updated table immediately.
To run the application, click Add Test Account.
You should see the following notification:
Click OK to reload the page and verify that the account has been added.
Delete records
To add the button for deleting each row in the ListView, modify the DataTemplate and handle the button's click event to remove the corresponding account.
1. Update MainPage.xaml to include the button in each row of the ListView:
privateasyncvoidOnDeleteAccountClicked(object sender, EventArgs e)
{
var button = (Button)sender;
var account = (Account)button.CommandParameter;
try
{
using (var connection = new ZohoConnection(AppConfig.ConnectionString))
{
await Task.Run(() => connection.Open());
var command = new ZohoCommand(
"DELETE FROM Accounts WHERE \"Account Name\" = :Account_Name", connection);
command.Parameters.Add(new ZohoParameter
{
ParameterName = ":Account_Name",
Value = account.Account_Name
});
int rowsAffected = await Task.Run(() => command.ExecuteNonQuery());
if (rowsAffected > 0)
{
await DisplayAlert("Success", "Account deleted successfully!", "OK");
await LoadAccounts();
}
else
{
await DisplayAlert("Error", "No rows were affected.", "OK");
}
}
}
catch (Exception ex)
{
await DisplayAlert("Error", $"Failed to delete account: {ex.Message}", "OK");
}
}
The OnDeleteAccountClicked method is called when the delete button is clicked. It retrieves the account associated with the button and executes an SQL command to delete the account from the database. After deletion, it refreshes the data to update the ListView.
Let's test the added logic. Click Delete next to Test Account.
You should see a notification that confirms the successful deletion.
Click OK to verify the result.
Conclusion
Integration of Zoho CRM into a .NET MAUI application is straightforward with dotConnect for Zoho CRM.
With ADO.NET, you can authenticate securely with OAuth, access CRM modules using SQL, and perform real-time read, insert, and delete operations — without writing any HTTP request logic.
FAQ
How do I install and activate dotConnect for Zoho CRM in a .NET project?
Install dotConnect for Zoho CRM using the EXE installer or by adding the Devart.Data.Zoho NuGet package to your project. Then obtain your Activation Key from your Devart Customer Portal and include it in the connection string via the License Key parameter.
How do I authenticate to Zoho CRM using Interactive OAuth in dotConnect?
To authenticate with Zoho CRM, use the connection string parameter Authentication Type=OAuthInteractive. When ZohoConnection opens, a browser window appears for you to sign in to your Zoho account and grant access. After authorization, dotConnect automatically retrieves and manages the access and refresh tokens.
How do I create a connection to Zoho CRM using dotConnect in C#?
Define a connection string that includes the URL of your Zoho CRM account, the authentication parameters, and the License Key. Then create a ZohoConnection instance and call Open() inside a try-catch block to establish the connection and handle potential errors.
Can I query Zoho CRM data using SQL with dotConnect?
Yes, dotConnect allows you to retrieve and manage Zoho CRM modules using SQL queries. Developers can work with entities such as Leads, Contacts, Accounts, and Deals using familiar SQL syntax.
Can I connect to Zoho CRM using Entity Framework Core and dotConnect?
Yes, you can use Entity Developer to visually generate an EF Core model from Zoho CRM modules, or run Scaffold-DbContext with the Devart.Data.Zoho.EFCore package and a dotConnect connection string (including License Key) to create DbContext and entity classes.
Is it possible to explore Zoho CRM data using the Visual Studio Server Explorer with dotConnect?
Yes. Open Server Explorer in Visual Studio, add a new Data Connection, select dotConnect for Zoho CRM as the provider, configure OAuth authentication, test the connection, and browse Zoho CRM modules directly from the IDE.
Dereck Mushingairi
I'm a technical content writer who loves turning complex topics—think SQL, connectors, and backend chaos—into content that actually makes sense
(and maybe even makes you smile). I write for devs, data folks, and curious minds who want less fluff and more clarity. When I'm not wrangling words,
you'll find me dancing salsa, or hopping between cities.