Show / Hide Table of Contents

    IDataStoreBase.MoveNext() Method

    .NET Standard 2.x

    Advances the enumerator to the next row of the primary buffer in DataStore.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

      public bool MoveNext();
    

    Returns

    System.Boolean

    True if the enumerator was successfully advanced to the next row.

    False if the enumerator has passed the end of the primary buffer.

    Examples

    The following code example demonstrates how to use the MoveNext method to get all of the data records from the DataStore.

    using Appeon.ApiDoc.Models;
    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreBaseExamples
    {
        public class MoveNextExample
        {
            private readonly SchoolContext _context;
    
            public MoveNextExample(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);
    
                D_Department department;
    
                datastore.Retrieve();            
    
                while (datastore.MoveNext())
                {
                    department = (D_Department)datastore.Current;
    
                    Console.WriteLine("Department ID: {0}; Department Name: {1}",
                                   department.Departmentid,
                                   department.Name);
                }
    
                /*This code produces the following output:
                 
                Department ID: 1; Department Name: Engineering
                Department ID: 2; Department Name: English
                Department ID: 4; Department Name: Economics
                Department ID: 7; Department Name: Mathematics
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon