C#+ArcEngine之模糊查询

IFeatureLayer pFLayer = (IFeatureLayer)m_pMap.get_Layer(0);

  string pname = textBox1.Text;
  IQueryFilter pQueryfilter = new QueryFilter();
  pQueryfilter.WhereClause = "NAME" + " LIKE '%"+pname+"%'";//模糊查询
  IFeatureCursor pCursor = pFLayer.Search(pQueryfilter, false);
  IFeature pFeature = pCursor.NextFeature();

  while (pFeature != null)
     {
        listBox1.Items.Add(pFeature.get_Value(pFeature.Fields.FindField("Name")).ToString());
        pFeature = pCursor.NextFeature();
               
       }

你可能感兴趣的:(ArcEngine)