示例#1
0
        public virtual DataTableInformation GetDataTableInformation(string strTableName, ref string strError)
        {
            try
            {
                // Sanitize Table Name
                strTableName = strTableName.Trim();

                // Validation
                if (strTableName == "")
                {
                    return(null);
                }

                // Get DataTable Information
                DataTableInformation tableInfo = new DataTableInformation(strTableName, this);

                return(tableInfo);
            }
            catch (Exception ex)
            {
                strError = ex.ToString();

                return(null);
            }
        }
        /// <summary>
        /// Database Constructor
        /// </summary>
        /// <param name="strTableName">Database table name</param>
        /// <param name="functions">IDatabaseFunctions object</param>
        public DataColumnInformationList(string strTableName, IDatabaseFunctions functions)
        {
            // Create New DataTableInformation
            DataTableInformation dataTableInformation = new DataTableInformation(strTableName, functions);

            // Add Columns To List
            this.AddRange(dataTableInformation.Columns.ToArray());
        }
        /// <summary>
        /// DataTable constructor
        /// </summary>
        /// <param name="dt">DataTable to build column list from</param>
        public DataColumnInformationList(DataTable dt)
        {
            // Create New DataTableInformation
            DataTableInformation dataTableInformation = new DataTableInformation(dt);

            // Add Columns To List
            this.AddRange(dataTableInformation.Columns.ToArray());
        }