Show / Hide Table of Contents

    IColumnMeta.ID Property

    .NET Standard 2.x

    Gets the zero-based ID of the column.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

    short ID { get; }
    

    Return

    System.Int16

    Returns the zero-based ID of the column.

    Examples

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

    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.IColumnMetaExamples
    {
        public class IDExample
        {
            private readonly SchoolContext _context;
    
            public IDExample(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 columnMetas = datastore.DwMeta.Columns;
                Console.WriteLine("Columns Count: {0}", columnMetas.Count);
    
                // Gets the zero-based ID of the column.  
                for (int i = 0; i < columnMetas.Count; i++)
                {
                    Console.WriteLine("Column Name: {0}; ID: {1}",
                        columnMetas[i].Name, columnMetas[i].ID);
                }
    
                /*This code produces the following output:
                
                Columns Count: 5
                Column Name: Departmentid;  ID: 0
                Column Name: Name;          ID: 1
                Column Name: Budget;        ID: 2
                Column Name: Startdate;     ID: 3
                Column Name: Administrator; ID: 4
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon