Conversion between JSON and C# DataTable

        Need to introduce JsonConvert.

        1. Convert DataTable to Json:

JsonConvert.SerializeObject(dataTable);

        2. Convert Json to DataTable

        Many bloggers on the Internet use regular analysis and other kinds of analysis. In fact, they don’t need a single code:

DataTable dt = (DataTable)JsonConvert.DeserializeObject(json, (typeof(DataTable)));

 

 

Guess you like

Origin blog.csdn.net/qq_41061437/article/details/110875483
Recommended