Show / Hide Table of Contents

    IDataStore.ImportEntry(IModelEntry modelEntry) Method

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

    0.5.0-alpha

    1.0.1 (current)

    Imports an IModelEntry object, which contains data and state, to the end of the DataStore.

    Namespace: PowerBuilder.Data

    Assembly: PowerBuilder.Data.dll

    Syntax

      public int ImportEntry(IModelEntry modelEntry);
    

    Parameters

    modelEntry SnapObjects.Data.IModelEntry

    An IModelEntry object which contains data and state.

    Returns

    System.Int32

    Returns 1 if succeeds.

    Examples

    The following example demonstrates how to add a row of data via a ModelEntry object to the DataStore.

    using Appeon.ApiDoc.Models.School;
    using SnapObjects.Data;
    using PowerBuilder.Data;
    using System;
    using System.Collections.Generic;
    
    namespace Appeon.ApiDoc.IDataStoreExamples
    {
        public class ImportEntryExample
        {
            private readonly SchoolContext _context;
    
            public ImportEntryExample(SchoolContext dataContext)
            {
                // Sets the data context.
                _context = dataContext;
            }
    
            public void Example1(IModelEntry<Person> persondata)
            {
                // Creates DataStore and imports a record.
                var person = new DataStore("d_person", _context);
    
                person.ImportEntry(persondata);
    
                Console.WriteLine("Rowcount: {0}", person.RowCount);
    
                /* The code example produces the following output:
                
                Rowcount: 1
                */
            }
        }
    }
    

    Example Refer To

    Controller Class: ImportEntryExampleController

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon