Esempio n. 1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="strTableName">Database table name</param>
        /// <param name="functions">Database functions object</param>
        public DataTableInformation(string strTableName, IDatabaseFunctions functions)
        {
            string strError = "";

            // Validation
            if (TableName == "" || functions == null)
            {
                return;
            }

            // Instantiate Column List
            this.m_Columns = new DataColumnInformationList();

            this.m_TableName = strTableName;

            // Get Table Exists
            this.m_TableExists = DatabaseInformation.CheckDataBaseTableExists(this.m_TableName, functions, ref strError);

            // Validation
            if (this.m_TableExists == false)
            {
                return;
            }

            // Load Table Information
            this.LoadTableInformationFromDatabase(strTableName, functions);
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor indluding a DataTable and an optional table name
        /// </summary>
        /// <param name="dt">DataTable to load information from</param>
        /// <param name="strTableName">DataTable name</param>
        public DataTableInformation(DataTable dt, string strTableName = "GENERIC_TABLE")
        {
            // Validation
            if (TableName == "")
            {
                return;
            }

            // Instantiate Column List
            this.m_Columns = new DataColumnInformationList();

            this.m_TableName = strTableName;

            // Load Table Information
            this.LoadTableInformationFromDataTable(dt, strTableName);
        }