📚 SAP Business One SDK Help

LoadSerializedXML Method
See Also  Example
dataTableXmlSelect
Indicates whether to load data, metadata, or both.
xml
A string in XML format that contains data or metadata or both for a data table.

Description

Loads data or metadata from an XML string.

XML can be retrieved from a data table with the SerializeAsXML method, modified, and then reloaded using this method. The XML schema can be obtained from the GetSchema method. 

Syntax

Visual Basic
Public Sub LoadSerializedXML( _
   ByVal dataTableXmlSelect As BoDataTableXmlSelect, _
   ByVal xml As String _
) 

Parameters

dataTableXmlSelect
ValueDescription
dxs_AllData and metadata of the data table
dxs_MetaDataOnly the metadata of the data table
dxs_DataOnlyOnly the data of the data table
Indicates whether to load data, metadata, or both.
xml
A string in XML format that contains data or metadata or both for a data table.

Example

Loading data/metadata into DataTable (C#)Copy Code
// Load metaData from XML file 
FileStream myFileStream = new FileStream("UTF16OnlyColumn.xml", FileMode.Open); 
StreamReader sr1 = new StreamReader(myFileStream); 
string strUTF8OnlyColumn = sr1.ReadToEnd(); 
 
// The LoadSerializedXML function can be used in 3 ways: data only, metadata, both data and metadata. 
// The usage is determined by the first parameter. 
// Here we show an example that loads only metadata. 
 
oGrid.DataTable.LoadSerializedXML(SAPbouiCOM.BoDataTableXmlSelect.dxs_MetaData, strUTF8OnlyColumn); 
 
sr1.Close(); 

See Also