Show / Hide Table of Contents

    IDataStore.GetItemDecimal(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 Decimal for the specified row and 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: PowerBuilder.Data

    Assembly: PowerBuilder.Data.dll

    Syntax

      public decimal? GetItemDecimal(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.Decimal?

    Returns the decimal? value in the specified row and column.

    Remarks

    Use GetItemDecimal when you want to get information from the DataWindow buffer. To access a row in the original buffer, specify the buffer that the row currently occupies (primary, delete, or filter) and the number of the row in that buffer. When you specify true for isOriginalValue, the method gets the original data for that row.

    Examples

    The following code example demonstrates how to use the GetItemDecimal method to get the decimal-type value in the specified row and column.

    using PowerBuilder.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreExamples
    {
        public class GetItemDecimalExample
        {
            private SchoolContext _context;
    
            public GetItemDecimalExample(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();
    
                datastore.SetItem(0, "budget", 100m);
    
                // Gets the original value in row 1 and in column 1 and 3 of DataStore.
                // Column 3 (Column name is Budget) is decimal type.   
                Console.WriteLine(
                    "Original value: Department ID: {0}; Budget: {1}",
                    datastore.GetItem(0, 0),
                    datastore.GetItemDecimal(0, 2, DwBuffer.Primary, true));
    
                // Gets the modified value in row 1 and in column 1 and 3 of DataStore  
                Console.WriteLine(
                    "Modified value: Department ID: {0}; Budget: {1}",
                     datastore.GetItem(0, 0),
                     datastore.GetItemDecimal(0, 2, DwBuffer.Primary, false));
    
                /*This code produces the following output:
                 
                Original value: Department ID: 1; Budget: 350000.0000
                Modified value: Department ID: 1; Budget: 100
                */
            }
        }
    }
    

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon