MapXtreme删除图层中某个对象

private void DelFenceInTable(Table table,String tableAlias,int id)
        {
            try
            {
                SearchInfo si = MapInfo.Data.SearchInfoFactory.SearchWhere("");

                IResultSetFeatureCollection ifs;

                if (table != null) //Table exists close it
                {
                    si = MapInfo.Data.SearchInfoFactory.SearchWhere("");

                    ifs = MapInfo.Engine.Session.Current.Catalog.Search(tableAlias, si);

                    foreach (Feature ft in ifs)
                    {
                        string ID = ft["ID"].ToString();
                        if (ID == id.ToString())
                        {
                            table.DeleteFeature(ft);
                            break;
                        }
                    }
                    table.Refresh();

                }
            }
            catch (Exception ex)
            {
                ExceptionLog.Log("DelFenceInTable " + ex.ToString());
            }
        }
原文地址:https://www.cnblogs.com/nygfcn1234/p/3146309.html