Show / Hide Table of Contents

    IDataStore.Item[int] Property

    .NET Standard 2.x

    Gets and sets the row data from the index location.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

       object this[int index] { get; set; }
    

    Parameters

    index System.Int32

    The index position of the row.

    Property Value

    System.Object

    Row data at the specified index position.

    Examples

    The following code example demonstrates how to use the Item property.

    using Appeon.ApiDoc.Models;
    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreExamples
    {
        public class ItemExample
        {
            private readonly SchoolContext _context;
    
            public ItemExample(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();
    
                var department = datastore[0] as D_Department;
    
                Console.WriteLine("Departmentid:{0},Name:{1},Budget:{2},Startdate:{3},Administrator:{4}",
                                   department.Departmentid, department.Name, department.Budget,
                                   department.Startdate, department.Administrator);
    
                /*This code produces the following output:
                
                Departmentid:1, Name:Engineering, Budget:220000.0000, 
                Startdate: 2007/9/1 00:00:00, Administrator:2
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon