Show / Hide Table of Contents

    IDataStore.GetItemBoolean(int row, short column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) Method

    .NET Standard 2.x | Current Version (1.0.1)

    0.5.0-alpha

    1.0.1 (current)

    Gets data whose type is Boolean for the specified row and column (specified by column number) 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: PowerBuilder.Data

    Assembly: PowerBuilder.Data.dll

    Syntax

      public bool? GetItemBoolean(int row, short column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false);
    

    Parameters

    row System.Int32

    The zero-based row number to get data.

    column System.Int16

    The zero-based column number to get data.

    bufferType PowerBuilder.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

    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 PowerBuilder.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreExamples
    {
        public class GetItemBooleanExample
        {
            private SchoolContext _context;
    
            public GetItemBooleanExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example1()
            {
                // Instantiates a DataStore object with datawindow: d_coursedescription.
                var datastore = new DataStore("d_coursedescription", _context);
    
                datastore.Retrieve();
    
                datastore.SetItem(0, "valid", true);
    
                // Gets the original value in row 1 and in column 2 and 5 of DataStore.
                // Column 5 (Column name is 'Valid') is bool? type.
                Console.WriteLine(
                    "Original value: Description: {0}; Valid: {1}",
                    datastore.GetItem<string>(0, 1),
                    datastore.GetItemBoolean(0, 4, DwBuffer.Primary, true));
    
                // Gets the modified value in row 1 and in column 2 and 5 of DataStore
                // Column 5 is boolean type
                Console.WriteLine(
                    "Modified value: Description: {0}; Valid: {1}",
                    datastore.GetItem<string>(0, 1),
                    datastore.GetItemBoolean(0, 4, DwBuffer.Primary, false));
    
                /*This code produces the following output:
                 
                Original value: Description: Calculus Description; Valid: False
                Modified value: Description: Calculus Description; Valid: True
                */
            }
        }
    }
    

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon