• 获取数据库中的要素类


    在ArcGIS Engine中,要得到某一个类,首要要获取工作空间,然后进入工作空间再得到相应的东西,我
    们定义一个函数用来获取个人数据库的路径
    public  string  WsPath()
            {
     
                string WsFileName="";
     
                OpenFileDialog OpenFile = new OpenFileDialog();
     
                OpenFile.Filter = "个人数据库(MDB)|*.mdb";
     
                DialogResult DialogR = OpenFile.ShowDialog();
     
                if (DialogR == DialogResult.Cancel)
                {
                   
                }
                else
                {
     
                    WsFileName = OpenFile.FileName;
                }
     
     
                return WsFileName;
               
            }
    要获取要素类,首先要进入
    private void button2_Click(object sender, EventArgs e)
            {
                     string WsName = WsPath();
     
                if (WsName != "")
                {
     
                    IWorkspaceFactory pWsFt = new AccessWorkspaceFactoryClass();
     
                    IWorkspace pWs = pWsFt.OpenFromFile(WsName, 0);
     
                    IEnumDataset pEDataset = pWs.get_Datasets(esriDatasetType.esriDTAny);
     
                    IDataset pDataset = pEDataset.Next();
     
                    while (pDataset != null)
                    {
                        if (pDataset.Type ==esriDatasetType.esriDTFeatureClass)
                        {
                            FeatureClassBox.Items.Add(pDataset.Name);
                        }
                           //如果是数据集
                        else if (pDataset.Type == esriDatasetType.esriDTFeatureDataset)
                        {
                            IEnumDataset pESubDataset = pDataset.Subsets;
     
                            IDataset pSubDataset = pESubDataset.Next();
     
                            while (pSubDataset != null)
                            {
                                FeatureClassBox.Items.Add(pSubDataset.Name);
     
                                pSubDataset = pESubDataset.Next();
                            }
                        }
                       
     
     
                        pDataset = pEDataset.Next();
                    }
     
                }
     
                FeatureClassBox.Text = FeatureClassBox.Items[0].ToString();
    }

    判断要素是否被编辑
    IDatasetEdit.IsBeingEdited

  • 相关阅读:
    AJAX MANAGER
    关闭IE浏览器的自动RSS阅读功能
    WCF REST Configuration for ASP.NET AJAX and plain REST Services
    jquery, json与ashx的完美结合
    ASP.NET 页面中的 ValidateRequest属性
    ASP.NET中的healthMonitoring
    GZip Compress SoapExtension
    ASP.NET MVC : UrlHelper
    Microsoft Ajax Content Delivery Network
    ASP.NET: TextBox控件如果设置为ReadOnly则PostBack之后可能丢失数据的问题
  • 原文地址:https://www.cnblogs.com/qiushuixizhao/p/3242413.html
Copyright © 2020-2023  润新知