DataStoreDataExtensions.ExportPlainXml(this IDataStoreBase dataStore, bool primaryData, bool filterData, bool deleteData, bool dwcdata) Method
.NET Standard 2.x
Exports data from the specified buffer(s) and/or DataWindowChild
to a plain-format XML string.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
public static string ExportPlainXml(this IDataStoreBase dataStore, bool primaryData, bool filterData, bool deleteData, bool dwcdata);
Parameters
primaryData
System.Boolean
A boolean
specifying whether to export the data from the primary buffer.
True
: to export;
False
: not to export.
filterData
System.Boolean
A boolean
specifying whether to export the data from the filter buffer.
True
: to export;
False
: not to export.
deleteData
System.Boolean
A boolean
specifying whether to export the data from the delete buffer.
True
: to export;
False
: not to export.
dwcdata
System.Boolean
Aboolean
specifying whether to export the DataWindowChild
data.
True
: to export.
False
: not to export.
Returns
System.String
Returns the XML string if it succeeds.
Examples
The following code example demonstrates how to export the course records (including DataWindowChild
) to XML strings. The "d_course" DataStore has a departmentid column which embeds a child DataWindow "dddw_deparment". When primaryData
is true
, exports data from the primary buffer to the XML string; when filterData
is true
, exports data from the filter buffer to the XML string; when deleteData
is true
, exports data from the delete buffer to the XML string; when dwcdata
is true
, exports data from the DataWindowChild
to the XML string.
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.DataStoreDataExtensionsExamples
{
public class ExportPlainXmlExample
{
private readonly SchoolContext _context;
public ExportPlainXmlExample(SchoolContext dataContext)
{
// Sets the data context
_context = dataContext;
}
public void Example4()
{
// Instantiates the datastore with datawindow: d_course
var datastore = new DataStore("d_course", _context);
// Generates data in the primary/delete/filter buffers for this example.
datastore.Retrieve();
datastore.DeleteRow(0);
datastore.SetFilter("courseid < 4000");
datastore.Filter();
// Exports all buffers including data of child DataWindow.
string xml1 = datastore.ExportPlainXml(true, true, true, true);
Console.WriteLine("ExportPlainXml(true, true, true, true):");
Console.WriteLine(xml1);
/*The exported XML file is:
ExportPlainXml4_1.xml
*/
// Exports all buffers excluding data of child DataWindow.
string xml2 = datastore.ExportPlainXml(true, true, true, false);
Console.WriteLine("ExportPlainXml(true, true, true, false):");
Console.WriteLine(xml2);
/*The exported XML file is:
ExportPlainXml4_2.xml
*/
}
}
}
Example Refer To
Model Classes: D_Course Dddw_Department
DataWindow File: d_course
Applies to
.NET Standard
2.x