Show / Hide Table of Contents

    DataStoreExtensions.GetRowData<TModel>(int row, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) Method

    .NET Standard 2.x

    Gets the data of the specified row in DataStore.

    Namespace: PowerScript.Bridge

    Assembly: PowerScript.Bridge.dll

    Syntax

    public static TModel GetRowData<TModel>(this IDataStoreBase dataStore, int row, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false);
    

    Parameters

    row System.Int32

    The zero-based row number to get data.

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

    TModel

    Returns the TModel object which contains the data of the row.

    Examples

    The following code example demonstrates how to use the GetRowData method to get the data of the second column in the first row in the primary buffer.

    using System;
    using DWNet.Data;
    using PowerScript.Bridge;
    using Appeon.ApiDoc.Models;
    
    namespace Appeon.ApiDoc.DataStoreExtensionsExamples
    {
        public class GetRowDataExample
        {
            private readonly SchoolContext _context;
    
            public GetRowDataExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example()
            {
                // Instantiates a DataStore object with datawindow: d_department.
                var datastore = new DataStore("d_department", _context);
               
                datastore.Retrieve();
                // Modifies the data of 2nd column in 1st row.
                datastore.SetItem(0, 1, "department name");
    
                // Gets the current value of 1st row in the primary buffer.
                var model = datastore.GetRowData<D_Department>(0, DwBuffer.Primary, false);
    
                Console.WriteLine($"model.Name={model.Name}");
    
                /*This code produces the following output:
                
                model.Name=department name           
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon