public static DBTableDetailEx GetTableStructEx(string connStr, string tableName, DataBaseType dbType)
        {
            IDBTableStructParser dbParser = new DBTableStructParser();

            dbParser.Initialize(connStr, dbType);
            return(dbParser.GetTableStructEx(tableName));
        }
Beispiel #2
0
        public DBTableDetailEx GetTableStructEx(string tableName)
        {
            DBTableDetail detail = this.GetTableStruct(tableName);

            DBTableDetailEx detailEx = new DBTableDetailEx();

            detailEx.TableName        = tableName;
            detailEx.TableDescription = tableName + "表没有描述。";

            detailEx.dtColumns = DBTableStructParser.CreateDBTableColumnsStruct();

            for (int i = 0; i < detail.Columns.Length; i++)
            {
                DataRow row = detailEx.dtColumns.NewRow();
                row[0] = detail.Columns[i].ColumnName;
                row[1] = detail.Columns[i].ColumnName;
                row[2] = detail.Columns[i].Description;
                row[3] = detail.Columns[i].ColumnType;
                row[4] = detail.Columns[i].Length;
                row[5] = detail.Columns[i].IsPkey;
                row[6] = detail.Columns[i].IsAutoID;
                row[7] = detail.Columns[i].DefaultValue;

                detailEx.dtColumns.Rows.Add(row);
            }

            return(detailEx);
        }