zoukankan      html  css  js  c++  java
  • 我研究出来的属性查询,贴自己的代码,请大家指教

    //把所有的字段都读进来

    private void Form2_Load(object sender, EventArgs e)

            {
                
                int i;
                ILayer pLayer=mFormShow1.axMapControl1.Map.get_Layer(0);
                IFeatureLayer pFeatureLayer = (IFeatureLayer)pLayer;
                IFeatureClass pFeatureClass = pFeatureLayer.FeatureClass;
                IField pField;
                for (i = 0; i < pFeatureClass.Fields.FieldCount; i++)
                {
                    pField = pFeatureClass.Fields.get_Field(i);
                    comboBox1.Items.Add(pField.Name);
                }


            }
    //根据条件进行查询
            private void button1_Click(object sender, EventArgs e)
            {
                
                ILayer pLayer = mFormShow1.axMapControl1.get_Layer(0);
                IGeoFeatureLayer pGeoFeatureLayer = (IGeoFeatureLayer)pLayer;
                ITable pTable = (ITable)pGeoFeatureLayer;
                IQueryFilter pQueryFilter = new QueryFilterClass();

                IFeatureCursor pFeatureCursor;
                ICursor pCursor;
                IFeature pFeature;

                pQueryFilter.WhereClause = comboBox1.Text + comboBox2.Text + textBox1.Text;
                pCursor = pTable.Search(pQueryFilter, true);
                pFeatureCursor = (IFeatureCursor)pCursor;

                pFeature = pFeatureCursor.NextFeature();

                while (pFeature != null)
                {
                    mFormShow1.axMapControl1.Map.SelectFeature(pGeoFeatureLayer, pFeature);
                    pFeature = pFeatureCursor.NextFeature();
                
                }
                mFormShow1.axMapControl1.Refresh();
                int RowCount = pTable.RowCount(pQueryFilter);
                MessageBox.Show(RowCount.ToString());



            }
  • 相关阅读:
    memcache概念浅谈及名称混乱之区分
    apache设置头
    Apache中关于页面缓存的设置
    memcahced&redis命令行cmd下的操作
    memcache命令行
    Memcached管理与监控
    memcache stats命令详解
    memcache基础知识-stats参数
    ab测试
    yum安装Apache,Mysql,PHP
  • 原文地址:https://www.cnblogs.com/zhangjun1130/p/1400078.html
Copyright © 2011-2022 走看看