IDataStoreBase.GetItems<TValue>(short column, DwBuffer bufferType = DwBuffer.Primary) Method
.NET Standard 2.x
Generic method. Gets the data for the specified column from the specified buffer of the DataStore. You can obtain the data that was originally retrieved and stored in the database, as well as the current value in the primary, delete, or filter buffers.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
IEnumerable<TValue> GetItems<TValue>(short column, DwBuffer bufferType = DwBuffer.Primary);
Parameters
column
System.Int16
The zero-based index number of the row.
bufferType
DWNet.Data.DwBuffer
The buffer of the DataStore.
Returns
System.IEnumerable<TValue>
The result set for the specified column.
Examples
The following code example demonstrates how to use the GetItems
method to get values in the specified column.
using DWNet.Data;
using System;
using System.Collections.Generic;
namespace Appeon.ApiDoc.IDataStoreBaseExamples
{
public class GetItemsExample
{
private readonly SchoolContext _context;
public GetItemsExample(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();
// Gets the values of column 1 of DataStore
// Column 1 is int type
var lists = datastore.GetItems<int>(0, DwBuffer.Primary);
foreach (var item in lists)
{
Console.WriteLine("Departmentid: {0}", item);
}
/*This code produces the following output:
Departmentid: 1
Departmentid: 2
Departmentid: 4
Departmentid: 7
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department
Applies to
.NET Standard
2.x