EasyObjects.NET Programmers Reference

EasyObject.ToXml Method ()

This method will allow you to save the contents of the EasyObject to XML. You can load this data into another EasyObject of the same type via FromXml. Call GetChanges before calling ToXml to serialize only the modified data.

public virtual string ToXml();

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 

' Now reload that single record into a new Employees object and Save it
Dim xml As String = emps.ToXml()
Dim empsClone As New Employees
empsClone.FromXml(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 

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

See Also

EasyObject Class | NCI.EasyObjects Namespace | EasyObject.ToXml Overload List