📚 SAP Business One SDK Help

SerializeAsXML Method
See Also  Example
dataTableXmlSelect
Indicates whether to return XML for the data, metadata, or both.

Description

Returns information about the data table (the data and metadata) in XML format.

The schema of the XML is available using the GetSchema method.

Syntax

Visual Basic
Public Function SerializeAsXML( _
   ByVal dataTableXmlSelect As BoDataTableXmlSelect _
) 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 return XML for the data, metadata, or both.

Example

Saving DataTable to XML (C#)Copy Code
//Load data to data table. 
dbQueryGrid.DataTable.ExecuteQuery("select CardCode, CardName, BalanceSys from [OCRD] where CardCode = N'a-'"); 
 
// Use SerializeAsXML to create an XML string. 
// SerializeAsXML 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 gets both data and metadata. 
 
string xml = dbQueryGrid.DataTable.SerializeAsXML(SAPbouiCOM.BoDataTableXmlSelect.dxs_All);

See Also