public CatalogEntityClassBase(string connString) { _dbConnection = DbConnectionFactory.CreateDbConnection(connString); _dbConnection.Open(); _connString = connString; _adapter = DiffDbAdapterFactory.GetDiffDbAdapter(_dbConnection); }
private string[] GetFieldsBySpatialFetClass(SpatialFeatureClass spatialFeatureClass) { using (IDbConnection dbConn = DbConnectionFactory.CreateDbConnection(_connectionString)) { dbConn.Open(); DiffDbAdapter _adapter = DiffDbAdapterFactory.GetDiffDbAdapter(dbConn); string shapeField = null; string oidfield = null; Dictionary <string, Type> fields = _adapter.GetFieldsOfTable(dbConn, spatialFeatureClass.DataTable, out shapeField, out oidfield); return(fields.Keys.ToArray()); } }
public void Import(Feature[] features, MetaFeatureClassDef fetclassdef, IDbConnection dbConnection, IProgressTracker tracker, params object[] args) { if (features == null) { throw new ArgumentNullException("features为空。"); } if (dbConnection == null) { throw new ArgumentNullException("dbConnection为空。"); } if (fetclassdef == null) { throw new ArgumentNullException("feactureClass.Name为空,无法确定数据表名。"); } _adapter = DiffDbAdapterFactory.GetDiffDbAdapter(dbConnection); string[] fields = features[0].FieldNames; Import(fetclassdef, fields, features, dbConnection, tracker); }
public FetClassWriterDb(ICatalogItem locationItem) { if (locationItem is CatalogDatabaseConn) { _dbConn = DbConnectionFactory.CreateDbConnection(((locationItem as CatalogDatabaseConn).Tag as SpatialDatabaseConn).ConnectionString); } else if (locationItem is CatalogFeatureDataset) { CatalogFeatureDataset cfd = locationItem as CatalogFeatureDataset; SpatialFeatureDataset sfd = cfd.Tag as SpatialFeatureDataset; _dbConn = DbConnectionFactory.CreateDbConnection((sfd as CatalogEntityBase)._connString); _datasetId = sfd.Id; _dstSpatialRef = SpatialReferenceFactory.GetSpatialReferenceByWKT(sfd.SpatialRef, enumWKTSource.EsriPrjFile); } else { throw new NotSupportedException("类型为\"" + locationItem + "\"的位置暂不支持写。"); } _adapter = DiffDbAdapterFactory.GetDiffDbAdapter(_dbConn); _dbConn.Open(); }
public SpatialDbBuilder(IDbConnection connection) { _adapter = DiffDbAdapterFactory.GetDiffDbAdapter(connection); }