Show / Hide Table of Contents

    IDataStore.GetValues(short column, DwBuffer bufferType = DwBuffer.Primary) Method

    .NET Standard 2.x

    Obtains a collection of values of the column (specified by the column number), from the specified buffer in the DataStore.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

      public IEnumerable<object> GetValues(short column, DwBuffer bufferType = DwBuffer.Primary);
    

    Parameters

    column System.Short

    The zero-based column number to get values.

    bufferType DWNet.Data.DwBuffer

    The specified buffer of the DataStore. The default is DwBuffer.Primary.

    Returns

    System.Collections.Generic.IEnumerable<System.Object>

    Returns an IEnumerable<System.Object> which can be used to read the data in the collection.

    Examples

    The following code example demonstrates how to get values of the second column (specified by the column number).

    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreExamples
    {
        public class GetValuesExample
        {
            private readonly SchoolContext _context;
    
            public GetValuesExample(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();
    
                // The lower bound of column is 0. 
                // Gets the values of the second column.
                var names = datastore.GetValues(1);
    
                Console.WriteLine("Department Name:");
    
                foreach (var name in names)
                {
                    Console.WriteLine(name);
                }
    
                /*This code produces the following output:
                 
                Department Name:
                Engineering
                English
                Economics
                Mathematics
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon