• ArcGIS Pro二次开发--数据库篇


    获得一个的要素的数据库:

    Geodatabase gdb = featureLayer.GetFeatureClass().GetDatastore() as Geodatabase;

    var id = row.GetTable().GetID();

    打开数据库

    Geodatabase fileGeodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(@"d:gisoracle.gdb")));

    sde数据库:

    Geodatabase enterpriseGeodatabaseViaConnectionFile = new Geodatabase(new DatabaseConnectionFile(new Uri(@"path	o	hesdefile")));
    
    DatabaseConnectionProperties connectionProperties = new DatabaseConnectionProperties(EnterpriseDatabaseType.SQLServer)
    {
      AuthenticationMode = AuthenticationMode.DBMS,
      Instance           = "machineName\instanceName",
      Database           = "databaseName",
      User               = "username",
      Password           = "Not1234"
      Version            = "dbo.DEFAULT"
    };
    
    Geodatabase enterpriseGeodatabaseViaConnectionProperties = new Geodatabase(connectionProperties);

     

    打开要素类

    FeatureClass table = geodatabase.OpenDataset<FeatureClass>("FeatureClassName");

    打开表

    Table table = geodatabase.OpenDataset<Table>("FeatureClassName");

    打开数据集

    FeatureDataset FeatureDataset = geodatabase.OpenDataset<FeatureDataset>("FeatureDatasetName");

  • 相关阅读:
    甲级1008 Elevator
    甲级1004 Counting Leaves
    甲级1007 Maximum Subsequence Sum
    甲级1006 Sign In and Sign Out
    甲级1005 Spell It Right
    甲级1003 Emergency
    甲级1002. A+B for Polynomials
    ..
    使用git版本管理打包增量更新包
    c++实现互斥锁
  • 原文地址:https://www.cnblogs.com/gisoracle/p/12508633.html
Copyright © 2020-2023  润新知