DataStoreDataExtensions.ExportRowAsXml(this IDataStoreBase dataStore, int row, DwBuffer dwBuffer = DwBuffer.Primary) Method
.NET Standard 2.x
Exports a row data from the specified buffer to an XML string.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
public static string ExportRowAsXml(this IDataStoreBase dataStore, int row,
DwBuffer dwBuffer = DwBuffer.Primary)
Parameters
row
System.Int32
The zero-based index number of the first row in the buffer that you want to export.
dwbuffer
DWNet.Data.DwBuffer
A value of the DwBuffer
enumerated datatype identifying the DataStore buffer
from which you want to export the data.
Returns
System.String
Returns the XML string if it succeeds.
Examples
The following code example demonstrates how to export a data row from the specified buffer to an XML string.
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.DataStoreDataExtensionsExamples
{
public class ExportRowAsXmlExample
{
private readonly SchoolContext _context;
public ExportRowAsXmlExample(SchoolContext dataContext)
{
// Sets the data context
_context = dataContext;
}
public void Example()
{
// Instantiates a DataStore object with datawindow: d_department.
var datastore = new DataStore("d_department", _context);
datastore.Retrieve();
// Exports the first row of data from the primary buffer.
string xml = datastore.ExportRowAsXml(0, DwBuffer.Primary);
Console.WriteLine(xml);
/*This code produces the following output:
<?xml version="1.0" encoding="utf-16"?>
<D_Department>
<Departmentid>1</Departmentid>
<Name>Engineering</Name>
<Budget>220000.0000</Budget>
<Startdate>2007-09-01T00:00:00</Startdate>
<Administrator>2</Administrator>
</D_Department>
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department
Applies to
.NET Standard
2.x