Work with data using code in Microsoft Dataverse
There are several different ways to access Dataverse data using code.
- Use the Dataverse SDK for .NET or Web API to retrieve, add, and modify data.
- Use Dataverse search search Dataverse data.
- Use the Dataverse Tabular Data Stream (TDS) endpoint to query data with SQL.
This article introduces the options you have to work with Dataverse data using code.
Retrieve, add, and modify data
Dataverse provides two ways to retrieve, add, and modify data: SDK for .NET & Web API. Choose the one that best matches the requirements, your skills, and preferences.
SDK for .NET
If you are working with .NET, we recommend using our SDK for .NET.
- Use the ServiceClient class in the DataverseServiceClient NuGet package if you have a client application.
- Use the Microsoft.CrmSdk.CoreAssemblies NuGet package when you are writing a plug-in or custom workflow activity.
The Dataverse SDK for .NET supports build targets for both .NET Framework and .NET 6+. However, plug-in and custom workflow activities must use .NET Framework.
If you are using our PowerShell module or using our custom log-in control with a Windows client application, use the the Xrm.Tooling
Web API
The Dataverse Web API is an OData v4 RESTful endpoint. Use the Web API for any programming language that supports HTTP requests and authentication using OAuth 2.0, including .NET.
- Learn to use the Dataverse Web API
- Quick Start: Web API with PowerShell and Visual Studio Code
- Quick Start: Web API sample (C#)
Search Dataverse data
Dataverse search delivers fast and comprehensive search results across multiple tables, in a single list, sorted by relevance. It also provides capabilities to support suggestions and autocompletion experiences in apps.
Search has a native endpoint and there are Dataverse messages that you can use from the Web API or SDK for .NET.
Learn to search for Dataverse records
Query data with SQL
The Power Query Dataverse connector uses the Dataverse Tabular Data Stream (TDS) endpoint to retrieve data using Dataverse SQL, a subset of Transact-SQL.
Retrieving data using SQL Management Studio (SSMS) is a preview feature.
Learn to use SQL to query data
Limitations
There's a 1-GB size limitation on the size of a response that Dataverse returns. Few APIs or queries are capable of returning this much data. If you encounter this limit, you should consider what other options are available to get the data in multiple, smaller requests.
The deprecated SOAP endpoint returns serialized XML data that is much more verbose than the serialized JSON data returned by the Web API. If you're using the deprecated SOAP endpoint, you should use the Web API equivalent operation. More information: About the legacy SOAP endpoint
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for