IDataStore.GetValues(string column, DwBuffer bufferType = DwBuffer.Primary) Method
.NET Standard 2.x
Obtains a collection of values of the column (specified by the column name), from the specified buffer in the DataStore.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
public IEnumerable<object> GetValues(string column, DwBuffer bufferType = DwBuffer.Primary);
Parameters
column
System.String
The name of a column to get values.
To get the contents of a computed field, specify the name of the computed field for column. Computed fields do not have numbers.
bufferType
DWNet.Data.DwBuffer
The specified buffer of the DataStore. The default is DwBuffer.Primary
.
Returns
System.Collections.Generic.IEnumerable<System.Object>
Returns an IEnumerable<System.Object>
which can be used to read the data in the collection.
Examples
The following code example demonstrates how to get values of the "name" column (specified by the column name).
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.IDataStoreExamples
{
public class GetValuesExample
{
private readonly SchoolContext _context;
public GetValuesExample(SchoolContext dataContext)
{
// Sets the data context
_context = dataContext;
}
public void Example2()
{
// Instantiates a DataStore object with datawindow: d_department.
var datastore = new DataStore("d_department", _context);
datastore.Retrieve();
// Gets the values of the name column.
var names = datastore.GetValues("name");
Console.WriteLine("Department Name:");
foreach (var name in names)
{
Console.WriteLine(name);
}
/*This code produces the following output:
Department Name:
Engineering
English
Economics
Mathematics
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department
Applies to
.NET Standard
2.x