Not a member? click here

Forgot your password? click here

Sample Code

This is the class code that goes with the sample. Table data is loaded into objects. This class represents data from the Customers table.

This code, along with the main program code represents an entire working program. You can find the main code here.


using System;
using Revelation.Dali;

namespace Revelation.Sample
{
    /// <summary>
    /// Represents an item from the Customers database table.
    /// </summary>
    [DaliClass(TableName="Customers")]
    public class Customer
    {
        /// <summary>
        /// Sets or gets the CustomerID of the object.
        /// This is the primary key column in the table.
        /// </summary>
        [DaliMember(ColumnName="CustomerID")]
        public string CustomerID;
        
        /// <summary>
        /// Sets or gets the CompanyName of the object.
        /// </summary>
        [DaliMember(ColumnName="CompanyName")]
        public string CompanyName;
        
        /// <summary>
        /// Sets or gets the ContactName of the object.
        /// </summary>
        [DaliMember(ColumnName="ContactName")]
        public string ContactName;
        
        /// <summary>
        /// Sets or gets the ContactTitle of the object.
        /// </summary>
        [DaliMember(ColumnName="ContactTitle")]
        public string ContactTitle;
        
        /// <summary>
        /// Sets or gets the Phone of the object.
        /// </summary>
        [DaliMember(ColumnName="Phone")]
        public string Phone;
        
        /// <summary>
        /// Default constructor.
        /// </summary>
        public Customer()
        {
        }
    }
}