Beispiel #1
0
 public object Clone()
 {
     var res = new TableInfo();
     res.Name = this.Name;
     res.Columns = new Dictionary<string, ColumnInfo>();
     foreach (var kvp in this.Columns)
         res.Columns.Add(kvp.Key, kvp.Value.Clone() as ColumnInfo);
     return res;
 }
Beispiel #2
0
 protected virtual void LoadTables(DbConnection Connection, Dictionary<string, TableInfo> Tables)
 {
     var dt = Connection.GetSchema("Tables");
     foreach (DataRow r in dt.Rows)
     {
         var info = new TableInfo();
         info.Name = r[TableNameColumnIndex] as string;
         Tables.Add(info.Name, info);
     }
     dt = Connection.GetSchema("Columns");
     foreach (DataRow r in dt.Rows)
     {
         var cinfo = new ColumnInfo();
         cinfo.TableName = r[2] as string;
         cinfo.Name = r[3] as string;
         LoadColumn(r, cinfo);
         cinfo.Type = TranslateType(cinfo.DbType);
         Tables[cinfo.TableName].Columns.Add(cinfo.Name, cinfo);
     }
 }