Show / Hide Table of Contents

    IDataStoreBase.OnRetrieveEnd(object sender, DwRetrieveEventArgs e) Method

    .NET Standard 2.x

    This method is called when the DataStore completes the data retrieval. It triggers the RetrieveEnd event by default, and it can be overridden in a child class of the DataStore.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

      public void OnRetrieveEnd(object sender, DwRetrieveEventArgs e);
    

    Parameters

    sender System.Object

    An event sender in which the event occurred.

    It is a reference to the current DataStore by default.

    e DWNet.Data.DwRetrieveEventArgs

    A DwRetrieveEventArgs object which can be used to pass by event arguments.

    Remarks

    The number of rows retrieved in the DwRetrieveEventArgs.RowCount argument is an unfiltered value.

    Examples

    The following code example gets the total number of data rows that are retrieved.

    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreBaseExamples
    {
        public class OnRetrieveEndExample
        {
            private readonly SchoolContext _context;
    
            public OnRetrieveEndExample(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);
    
                // Defines what to do when Retrieve is completed.
                datastore.RetrieveEnd +=
                    (sender, args) =>
                    {
                        Console.WriteLine("After Retrieve, Rowcount: {0}",
                            args.RowCount);
                    };
    
                // Retrieves rows from the database for datastore.
                // OnRetrieveEnd method is called internally to invoke the 
                // RetrieveEnd event.
                datastore.Retrieve();
    
                /*This code produces the following output:
                
                After Retrieve, Rowcount: 4           
                */
    
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon