Show / Hide Table of Contents

    IDataStore.DeletedCount Property

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

    0.5.0-alpha

    1.0.1 (current)

    Gets the total number of rows that are marked for deletion in the database.

    Namespace: PowerBuilder.Data

    Assembly: PowerBuilder.Data.dll

    Syntax

      public int DeletedCount { get; }
    

    System.Int32

    The total number of rows that are marked for deletion in the database.

    Examples

    The following code example deletes the data in the DataStore and then uses the DataStore DeletedCount property to get the total number of the deleted rows.

    using PowerBuilder.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreExamples
    {
        public class DeletedCountExample
        {
            private SchoolContext _context;
    
            public DeletedCountExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example()
            {
                // Instantiates datastore with datawindow: d_department.
                var datastore = new DataStore("d_department", _context);
                
                datastore.Retrieve();
    
                Console.WriteLine("Retrieved Rowcount: {0}",
                                   datastore.RowCount);
    
                // Deletes the first row in datastore.
                datastore.DeleteRow(0);
    
                Console.WriteLine("After deleted, Deletedcount: {0}",
                                   datastore.DeletedCount);
    
                Console.WriteLine("After deleted, Rowcount: {0}",
                                   datastore.RowCount);
    
                /*This code produces the following output:
                
                Retrieved Rowcount: 4
                After deleted, Deletedcount: 1
                After deleted, Rowcount: 3
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon