IDwDataExporter.ExportRow(int row, DwBuffer dwBuffer = DwBuffer.Primary) Method
.NET Standard 2.x
Export one row data from the specified buffer of the DataStore in the specified DataFormat
.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
string ExportRow(int row, DwBuffer dwBuffer = DwBuffer.Primary);
Parameters
row
System.Int32
The zero-based index number of the row.
dwbuffer
DWNet.Data.DdwBuffer
A value of the DwBuffer
enumerated datatype identifying the DataWindow buffer
from which you want to export the data. For a list of valid values, see DWBuffer.
Returns
System.String
Data string in the specified format.
Reference Plain JSON
Examples
Exports a row data from the specified buffer to a JSON string.
using DWNet.Data;
using SnapObjects.Data;
using System;
namespace Appeon.ApiDoc.IDwDataExporterExamples
{
public class ExportRowExample
{
private readonly SchoolContext _context;
public ExportRowExample(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();
// Get DataStore exporter in JSON format.
var exporter = datastore.GetDataExporter(DataFormat.Json);
// Export the first row of data in the primary buffer.
string json = exporter.ExportRow(0, DwBuffer.Primary);
Console.WriteLine(json);
/*This code produces the following output:
{"Departmentid":1,"Name":"Engineering","Budget":220000.0000,"Startdate":"2007-09-01T00:00:00","Administrator":2}
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department