corelibraries-devexpress-dot-dataaccess-dot-json-dot-jsondatasource.md
Specifies how many data source elements to analyze on each level to build the schema.
Namespace : DevExpress.DataAccess.Json
Assembly : DevExpress.DataAccess.v25.2.dll
NuGet Package : DevExpress.DataAccess
[DefaultValue(100)]
[LocalizableCategory(DataAccessStringId.PropertyGridDataCategoryName)]
public int SchemaDiscoveryMaxItemCount { get; set; }
<DefaultValue(100)>
<LocalizableCategory(DataAccessStringId.PropertyGridDataCategoryName)>
Public Property SchemaDiscoveryMaxItemCount As Integer
| Type | Default | Description |
|---|---|---|
| Int32 | 100 |
The number of data source elements to analyze on each level to build the schema.
|
Use this property to limit the number of data source records that the JsonDataSource uses to build the schema. This improves performance for data sources with a large number of records.
Set this property to 0 to analyze all data source records.
If a record contains an array of nested records, the same limit applies to the nested records to build their schema.
This property is not in effect if the Schema property has a value different from null ( Nothing in Visual Basic) before you call the Fill() method.
In the Data Source Wizard , you can use the IWizardJsonDataSourceSchemaDiscoveryInterceptor service to specify the SchemaDiscoveryMaxItemCount value.
The code sample below creates a new JSON data source and uses the first 5 records to build the schema.
using DevExpress.DataAccess;
using DevExpress.DataAccess.Json;
// ...
// Create a new JSON source.
var jsonSource = new UriJsonSource() {
Uri = new Uri(@"https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/customers.json")
};
// Assign the JSON source to the data source. Use the first 5 records to build the schema.
var datasource = new JsonDataSource() {
JsonSource = jsonSource,
SchemaDiscoveryMaxItemCount = 5
};
Imports DevExpress.DataAccess
Imports DevExpress.DataAccess.Json
' ...
' Create a new JSON source.
Dim jsonSource = New UriJsonSource() With {.Uri = New Uri("https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/customers.json")}
' Assign the JSON source to the data source. Use the first 5 records to build the schema.
Dim datasource = New JsonDataSource() With {.JsonSource = jsonSource, .SchemaDiscoveryMaxItemCount = 5}
See Also