Use JsonDataSource
The JsonDataSource component allows you to obtain data from a Web service endpoint, text file, or JSON string.
Configure the JsonDataSource object at runtime as follows:
- Use the JsonSource property to specify the JSON data location.
- Optional. Use the Schema property to specify JSON nodes to retrieve data.
- Use the Fill or FillAsync method to retrieve data.
The JsonDataSource
object uses the System.Text.Json library. Install the System.Text.Json package if your application does not reference this library. .NET projects do not require manual installation of the System.Text.Json package, as it is already included in the .NET environment. Set the DevExpress.DataAccess.Native.Json.JsonLoaderHelper.ProcessingLibrary
property to NewtonsoftJson
to use the Newtonsoft.Json library instead.