Show / Hide Table of Contents

    IDataStore.RetrieveStart Event

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

    0.5.0-alpha

    1.0.1 (current)

    Occurs when the retrieval is about to begin.

    Namespace: PowerBuilder.Data

    Assembly: PowerBuilder.Data.dll

    Syntax

      public event Action<object, DwRetrieveEventArgs> RetrieveStart;
    

    Remarks

    To prevent the previously retrieved data from being cleared, set DwRetrieveEventArgs.IsResetBuffer to false to allow the current retrieval process to append new rows to the old data.

    To cancel the retrieval, set DwRetrieveEventArgs.IsCancel to true.

    Examples

    The following code example demonstrates that the RetrieveStart event is triggered when DataStore starts retrieving data.

    using PowerBuilder.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreExamples
    {
        public class RetrieveStartExample
        {
            private SchoolContext _context;
    
            public RetrieveStartExample(SchoolContext dataContext)
            {
                // Sets the data context.
                _context = dataContext;
            }
    
            public void Example()
            {
                // Instantiates datastore with datawindow: d_department.
                var department = new DataStore("d_department", _context);
    
                // Defines what to do when retrieval starts.
                department.RetrieveStart +=
                    (object sender, DwRetrieveEventArgs args) =>
                    {
                        Console.WriteLine("Begin to retrieve data for DataStore.");
                    };
    
                department.Retrieve();
    
                /*This code produces the following output:
                
                Begin to retrieve data for DataStore.
                */
    
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon