示例#1
0
        public DataTableInfo(string dbn, string tbn, db_t dbinfo)
        {
            Parent = dbinfo;
            foreach (DataRow dr in Parent.SchemaColumns.Rows)
            {
                string tablename = string.Format("{0}", dr["TABLE_NAME"]);
                string dbname    = string.Format("{0}", dr["TABLE_SCHEMA"]);

                if (tablename == tbn && dbname == dbn)
                {
//					Global.statY("table: “{0}”, db: “{1}”",tablename,dbname);
                    string field = string.Format("{0}", dr["COLUMN_NAME"]);
                    _fnames.Add(field);
                    field_infos.Add(field, new table_field_info(dr));
                }
            }
        }
示例#2
0
        public DatabaseNfo(db_t dbt, string database)
        {
            // string info
            foreach (DataRow dr in dbt.SchemaTables.Rows)
            {
                if (string.Format("{0}", dr["TABLE_SCHEMA"]) == database)
                {
                    table_names.Add(string.Format("{0}", dr["TABLE_NAME"]));
                }
            }
            // type info
            foreach (string dbn in dbt.DatabaseNames)
            {
                if (dbn == database)
                {
                    foreach (string tbn in table_names)
                    {
//						Global.statB("database “{0}”, table “{1}”",dbn,tbn);
                        _tinfo.Add(tbn, new DataTableInfo(dbn, tbn, dbt));
                    }
                }
            }
        }