JsonDataSource.Fill() Method

Populates the JsonDataSource object with JSON data.

Namespace: DevExpress.DataAccess.Json

Assembly: DevExpress.DataAccess.v20.2.dll

Declaration

public void Fill()
Public Sub Fill

Remarks

Use the Fill method to populate the JsonDataSource with data.

If you did not define the data source schema, the data source is populated with all data available from the source.

The JsonDataSourceException exception occurs if the Fill method failed to populate the data source. Catch this exception or handle the FillError event to ensure that the Fill method has completed successfully.

Example

The code sample below creates a JSON data source and populates it with data from the endpoint.

using DevExpress.DataAccess.Json;
// ...
// Create a new JSON data source and populate it with data.
var jsonDataSource = new JsonDataSource();
jsonDataSource.JsonSource = new UriJsonSource() {
    Uri = new Uri(@"https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/customers.json")
};
jsonDataSource.Fill();
See Also