IDataStore.GetItemBoolean(int row, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) Method
.NET Standard 2.x
Gets data whose type is Boolean
for the specified row and column (specified by column name) 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
public bool? GetItemBoolean(int row, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false);
Parameters
row
System.Int32
The zero-based row number to get data.
column
System.String
The name of a column to get data.
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.
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
System.Boolean?
Returns the bool?
value in the specified row and column.
Examples
The following code example demonstrates how to use the GetItemBoolean
method to get the boolean-type value in the specified row and column.
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.IDataStoreExamples
{
public class GetItemBooleanExample
{
private readonly SchoolContext _context;
public GetItemBooleanExample(SchoolContext dataContext)
{
// Sets the data context
_context = dataContext;
}
public void Example2()
{
// Instantiates a DataStore object with datawindow: d_coursedescription.
var datastore = new DataStore("d_coursedescription", _context);
datastore.Retrieve();
// Sets the "valid" column in the first row to "true".
datastore.SetItem(0, "valid", true);
// Gets the original value in the first row and in the 'description' column and
// the 'valid' column of DataStore. The 'valid' column is bool? type.
Console.WriteLine(
"Original value: Description: {0}; Valid: {1}",
datastore.GetItem<string>(0, "description"),
datastore.GetItemBoolean(0, "valid",
DwBuffer.Primary, true));
// Gets the modified value in the first row and in the 'description' column and
// the 'valid' column of DataStore
Console.WriteLine(
"Modified value: Description: {0}; Valid: {1}",
datastore.GetItem<string>(0, "description"),
datastore.GetItemBoolean(0, "valid",
DwBuffer.Primary, false));
/*This code produces the following output:
Original value: Description: Calculus Description; Valid: False
Modified value: Description: Calculus Description; Valid: True
*/
}
}
}
Example Refer To
Model Class: D_Coursedescription
DataWindow File: d_coursedescription
Applies to
.NET Standard
2.x