Show / Hide Table of Contents

    IDataStore.Evaluate<TValue>(string expression, int row) Method

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

    0.5.0-alpha

    1.0.1 (current)

    Calculates the specified DataWindow expression using the specified row (by the index number) in the primary buffer of the DataStore.

    Namespace: PowerBuilder.Data

    Assembly: PowerBuilder.Data.dll

    Syntax

      public TValue Evaluate<TValue>(string expression, int row);
    

    Type Parameters

    TValue

    The type of the result value.

    Parameters

    expression System.String

    A DataWindow expression to evaluate.

    row System.Int32

    Returns

    TValue

    The result value.

    Examples

    The following code example demonstrates how to use the Evaluate<TValue>(String, Int32) method.

    using PowerBuilder.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreExamples
    {
        public class EvaluateExample
        {
            private SchoolContext _context;
    
            public EvaluateExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example2()
            {
                // Instantiates a DataStore object with dataobject: d_department
                var datastore = new DataStore("d_department", _context);
    
                datastore.Retrieve();
    
                // This datastore has 4 records
                // Values of the first record is:
                // Name: Engineering; Budget: 350000.00
    
                string nameAndBudget = datastore.Evaluate<string>("name +': ' + budget)", 0);
    
                Console.WriteLine(nameAndBudget);
    
                /*This code produces the following output:
                
                Engineering: 350000.0000
                */
            }
        }
    }
    

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon