Show / Hide Table of Contents

    IDataStoreBase.TotalCount Property

    .NET Standard 2.x

    Gets the total number of rows in all buffers of the DataStore.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

     public int TotalCount { get; }
    

    Property Value

    System.Int32

    The total number of rows in all buffers of the DataStore.

    Examples

    The following code example demonstrates how to use the TotalCount property to get the total number of the rows in all buffers of the DataStore after filtering data by criteria (Budget >= 200000) and deleting data from the DataStore.

    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreBaseExamples
    {
        public class TotalCountExample
        {
            private readonly SchoolContext _context;
    
            public TotalCountExample(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 Totalcount: {0}",
                    datastore.TotalCount);
    
                Console.WriteLine("Retrieved Rowcount: {0}",
                    datastore.RowCount);
    
                // Filters data that do not meet criteria 'Budget >= 200000'
                datastore.SetFilter("Budget >= 200000");
                datastore.Filter();
    
                Console.WriteLine("After filtered, Totalcount: {0}",
                    datastore.TotalCount);
    
                Console.WriteLine("After filtered, Rowcount: {0}",
                    datastore.RowCount);
    
                // Deletes the first row in the DataStore
                datastore.DeleteRow(0);
    
                Console.WriteLine("After deleted, Totalcount: {0}",
                    datastore.TotalCount);
    
                Console.WriteLine("After deleted, Rowcount: {0}",
                    datastore.RowCount);
    
                /*This code produces the following output:
                
                Retrieved Totalcount: 4
                Retrieved Rowcount: 4
                After filtered, Totalcount: 4
                After filtered, Rowcount: 3
                After deleted, Totalcount: 4
                After deleted, Rowcount: 2
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon