EasyObjects.NET Programmers Reference

EasyObject.Serialize Method 

This method will allow you to save the contents of the EasyObject to XML. It is saved as a DataSet with Schema, data, and Rowstate as a DiffGram. You can load this data into another entity of the same type via Deserialize. Call GetChanges before calling Serialize to serialize only the modified data.

public virtual string Serialize();

Return Value

A string containing the XML

Example

VB.NET

Dim emps As New Employees
emps.Query.Load()              ' emps.RowCount = 200
emps.FirstName = "Noonan"      ' Change first row
emps.GetChanges()              ' emps.RowCount now = 1 
Dim xml As String = emps.Serialize()

' Now reload that single record into a new Employees object and Save it
Dim empsClone As New Employees
empsClone.Deserialize(xml)
empsClone.Save()
C#
Employees emps = new Employees();
emps.LoadAll();                // emps.RowCount = 200
emps.LastName = "Noonan";      // Change first row
emps.GetChanges();             // emps.RowCount now = 1 
string str = emps.Serialize();

// Now reload that single record into a new Employees object and Save it
Employees empsClone = new Employees();
empsClone.Deserialize(str);
empsClone.Save();

See Also

EasyObject Class | NCI.EasyObjects Namespace