Serializer Types

Overview

There is only one type DataSetSerializer in the serializer category. It provides two methods - one to serialize data set and the second one to deserialize data set.

Declaration

/// <summary>
/// Restores data set from JSON string
/// </summary>
/// <param name="serializedDataSet">Serialized data set</param>
/// <returns>Restored data set from JSON string</returns>
public static IDataSet? FromJsonString(string? serializedDataSet)

/// <summary>
/// Gets data set JSON string representation
/// </summary>
/// <param name="dataSet">Data set for serialization</param>
/// <returns>Data set JSON string representation</returns>
public static string? ToJsonString(IDataSet? dataSet)

Namespace and Assembly

Namespace: PocoDataSet.Serializer
Assembly: PocoDataSet.Serializer.dll

Usage Example

// 1. Create data set
IDataSet dataSet = DataSetFactory.CreateDataSet();

// 2. Create Employee data table
IDataTable employeeTable = dataSet.AddNewTable("Employee");
employeeTable.AddColumn("Id", DataTypeNames.INT32);
employeeTable.AddColumn("FirstName", DataTypeNames.STRING);

// 3. Add a new row
IDataRow dataRow = employeeTable.AddNewRow();
dataRow["Id"] = 1;
dataRow["FirstName"] = "Sara";

// 4. Call ToJsonString method to serialize data set to JSON string
string? jsonString = DataSetSerializer.ToJsonString(dataSet);

// 5. Call FromJsonString method to deserialize JSON string back to data set
IDataSet? deserializedDataSet = DataSetSerializer.FromJsonString(jsonString);

 

Table of Content POCO DataSet API References

 


Business Process Programming in .Net
© 2004–2026 Laskarzhevsky Software Inc.
Unless otherwise noted, the content of this website is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
You are free to share and adapt the material provided that appropriate credit is given and any modifications are clearly indicated.
The information provided on this website is for educational purposes only.
The author and publisher make no warranties regarding the completeness or suitability of the information and are not responsible for any damages resulting from its use.

 


Business Process Programming in .Net
© 2004–2026 Laskarzhevsky Software Inc.
Unless otherwise noted, the content of this website is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
Code examples are provided under the MIT License.
You are free to share and adapt the material provided that appropriate credit is given and any modifications are clearly indicated.
The information provided on this website is for educational purposes only.
The author and publisher make no warranties regarding the completeness or suitability of the information and are not responsible for any damages resulting from its use.