当前位置:网站首页>ArcEngine secondary development based on C 57: the owner Sid on each user subscription does not exist
ArcEngine secondary development based on C 57: the owner Sid on each user subscription does not exist
2022-06-21 06:39:00 【Xiao Xue leads the way】
Problem description :
pFeatCursor = pFeatCls.Search(pQueryFilter, true); The following error appears :
Untreated System.Runtime.InteropServices.COMException
Message=" Everyone on a per user subscription SID non-existent ( Exception from HRESULT:0x80040207)"
Treatment scheme :
This exception occurs as long as it is caused by the filter WhereClause Caused by nonstandard statement , Solution :
- Add a quote modifier to the field name ,"fieldName"
- Add a single quote modifier to the value of the field ,"20010200LL00BS"
- The modified query statement is : "\"fieldName\" = '20010200LL00BS'"
The revised code is as follows :
private void btnOk_Click(object sender, EventArgs e)
{
// Defining layers , Feature cursor , Query filter , elements
IFeatureLayer pFeatureLayer = this.axMapControl1.Map.get_Layer(cboLayer.SelectedIndex ) as IFeatureLayer;
IFeatureClass pFeatureClass = pFeatureLayer.FeatureClass;
string strFldName = pFeatureClass.Fields.get_Field(cboField.SelectedIndex).Name;
IQueryFilter pQueryFilter = new QueryFilterClass();
pQueryFilter.WhereClause = "strFldName='" + txtStateName.Text + "'";
IFeatureCursor pFeatureCursor = pFeatureLayer.Search(pQueryFilter, true);
IFeature pFeature = pFeatureCursor.NextFeature();
}Expand knowledge :
The inspection found that QueryFilter.WhereClause Statement in query shapefile There's a problem with the format layer , I'm trying to find out gdb The format of the layer will not report an error . open ArcGIS Comparing the two formats of attribute query, there are the following differences :
- shapefile Use double quotation marks for the field name of :"fieldName" and GDB Adoption of [fieldName] Format ;
- shapefile Fuzzy query with like '%A%' and GDB use like '*A*' ;
- shapefile The noncharacter field of does not support fuzzy queries and GDB Format support ; But I remember 9.2 It's like supporting ^_^.
Therefore, you must judge the data source type of the layer before querying :
if (pDateset.Workspace.Type == esriWorkspaceType.esriFileSystemWorkspace)
{
pQueryFilter.WhereClause = "\"" + fldName + "\"" + " like '%" + this.txt_findObject.Text.Trim() + "%'"; //shpfile
}
else
{
pQueryFilter.WhereClause = "[" + fldName + "]" + " like '*" + this.txt_findObject.Text.Trim() + "*'"; //gdb
}边栏推荐
- Old users come back and have a look
- PyG教程(6):自定义消息传递网络
- Niuke-top101-bm26
- [data mining] final review Chapter 3
- That's great. MySQL's summary is too comprehensive
- [[graduation season · advanced technology Er] - experience shared by senior students
- 第8期:云原生—— 大学生职场小白该如何学
- Pycharm设置项目的默认解释器
- EasyUI监听鼠标按下事件&监听键盘事件【简单详细】
- 【笔记自用】myeclipse连接MySQL数据库详细步骤
猜你喜欢

MSF内网渗透

Sqlmap tool

Docker installing MySQL

Blasting with burp (ordinary blasting + verification code blasting)

Issue 7: roll inside and lie flat. How do you choose

TweenMax示波器3d动画

海明码校验【简单详细】

NOP法破解简易登录系统
![[data mining] final review Chapter 4](/img/40/725c40bda7dcda02325e46991129aa.png)
[data mining] final review Chapter 4
![[[graduation season · advanced technology Er] - experience shared by senior students](/img/15/720dac05ebba3ead1b82b15f15daa6.png)
[[graduation season · advanced technology Er] - experience shared by senior students
随机推荐
Direct attack on the Internet layoffs in 2022: flowers on the ground, chicken feathers on the ground
Small program [phase I]
[data mining] final review Chapter 1
User defined thread pool
【JDBC从入门到实战】JDBC基础通关教程(全面总结上篇)
糖果隧道js特效代码
PostgreSQL和MySQL应该如何选择
Issue 7: roll inside and lie flat. How do you choose
Pycharm设置项目的默认解释器
155-Solana存储数组
Excel_submit
How to access MySQL database through JDBC? Hand to hand login interface (illustration + complete code)
当今的数学是否过于繁琐?
[[graduation season · advanced technology Er] - experience shared by senior students
[data mining] final review Chapter 4
MySQL数据库基础:子查询
Niuke-top101-bm25
scikit-learn中的Scaler
154-Solana分发token
【input】输入框事件总结