TX Text Control .NET for Windows Forms

LoadJson Method

Method|Introduced in 24.0
Namespace
TXTextControl.DocumentServer.DataSources
Package
TXTextControl.TextControl.WinForms.SDK as TXDocumentServer.dll from the private NuGet feed or Text Control Offline Packages

Description

Loads a JSON string containing an array of objects or a single object as a data source. Automatically deduces table and column names as well as data relations from property names and nested objects in the given single object or, in case of an array, the first object.

Syntax

public void LoadJson(string json);

Parameters

ParameterDescription
json

A JSON string containing a single object or an array of objects.

Examples

The following example uses Load Json in a focused Data Source Manager workflow. The created object is then available to the surrounding document workflow.

dataSourceManager.LoadJson("Quarterly report");
Console.WriteLine("Data Source Manager is ready for use.");