Пример #1
0
 public static TableInfo GetTableInfo(this DataColumnCollection columns)
 {
     TableInfo res = new TableInfo(null);
     foreach (DataColumn col in columns.SortedByKey<DataColumn, int>(col => col.Ordinal))
     {
         var commonType = TypeTool.GetCommonType(col.DataType);
         var colInfo = res.AddColumn(col.ColumnName, commonType.ToString(), TypeTool.GetCommonType(col.DataType));
         colInfo.NotNull = !col.AllowDBNull;
     }
     return res;
 }
Пример #2
0
 public static TableInfo GetStructure(bool addFileIdentifier)
 {
     var res = new TableInfo(null);
     res.AddColumn("_ShapeId_", "int", new DbTypeInt());
     res.AddColumn("_PartId_", "int", new DbTypeInt());
     res.AddColumn("_VertexId_", "int", new DbTypeInt());
     res.AddColumn("_X_", "float", new DbTypeFloat());
     res.AddColumn("_Y_", "float", new DbTypeFloat());
     if (addFileIdentifier)
     {
         res.AddColumn("_File_", "nvarchar(250)", new DbTypeString());
     }
     return res;
 }