Show / Hide Table of Contents

    IDataStore.OnInitialized() Method

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

    0.5.0-alpha

    1.0.1 (current)

    Executes this method when instantiating the DataStore. This method triggers the Initialized event by default, and it can be overridden in a child class of the DataStore.

    Namespace: PowerBuilder.Data

    Assembly: PowerBuilder.Data.dll

    Syntax

      public void OnInitialized();
    

    Examples

    The following code example demonstrates how to use the OnInitialized method.

    using PowerBuilder.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreExamples
    {
        public class OnInitializedExample
        {
            private SchoolContext _context;
    
            public OnInitializedExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example()
            {
                // Instantiates a DataStore object with datawindow: d_department.
                var datastore = new NewDataStore("d_department", _context);
    
                /* The code produces the following output:
                
                DataStore has been instantiated.
                */
            }
    
            public class NewDataStore : DataStore
            {
                public NewDataStore(string dataobject, SchoolContext context)
                    : base(dataobject, context)
                {
    
                }
    
                public override void OnInitialized()
                {
                    Console.WriteLine("DataStore has been instantiated.");
                }
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon