DataStoreExtensions.GetValues<TValue>(string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) Method
.NET Standard 2.x
Gets the data of the specified column.
Namespace: PowerScript.Bridge
Assembly: PowerScript.Bridge.dll
Syntax
public static TValue[] GetValues<TValue>(this IDataStoreBase dataStore, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false);
Parameters
column
System.String
The zero-based column number to get data.
bufferType
DwNet.Data.DwBuffer
The specified buffer of the DataStore. The default is DwBuffer.Primary
.
isOriginalValue
System.Boolean
Whether to obtain the data that was originally retrieved.
True
: to obtain the data that was originally retrieved.
False
(default): to obtain the current data.
Returns
TValue[]
Returns the TValue[]
object which contains the data of the specified column.
Examples
The following code example demonstrates how to use the GetValues
method to get the original values of the Name column in the primary buffer of DataStore.
using System;
using DWNet.Data;
using PowerScript.Bridge;
namespace Appeon.ApiDoc.DataStoreExtensionsExamples
{
public class GetValuesExample
{
private readonly SchoolContext _context;
public GetValuesExample(SchoolContext dataContext)
{
// Sets the data context
_context = dataContext;
}
public void Example1()
{
// Instantiates a DataStore object with datawindow: d_department.
var datastore = new DataStore("d_department", _context);
datastore.Retrieve();
// Modifies the data in the first row
datastore.SetItem(0, 1, "department name");
// Gets the original data values in the primary buffer
var names = datastore.GetValues<string>("Name", DwBuffer.Primary, true);
Console.WriteLine($"names Length={names.Length}, names[0]={names[0]}");
/*This code produces the following output:
names Length=4, names[0]=Engineering
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department
Applies to
.NET Standard
2.x