English 中文(简体)
What does the exception "Exception from HRESULT: 0x80040653" when calling IFeatureClass.Search in ArcObjects mean?
原标题:

I m supporting an application built on ESRI ArcObjects where the original developers are long since gone. The application after having worked fine for a couple of years has started failing with this exception. The application runs on a daily schedule.

The error message isn t very helpful. Any ideas what the cause of the error might be?

Exception from HRESULT: 0x80040653
Date: Thursday, 4 March 2010
Time: 1:47:33 a.m.
Stack trace:    
   at ESRI.ArcGIS.Geodatabase.IFeatureClass.Search(IQueryFilter filter, Boolean Recycling)
最佳回答

It turns out the error was caused by the IQueryFilter.WhereClause property that was getting passed into the Search method, contained the name of a field that didn t exist in the feature class.

It would be nice if the exception thrown had a relevant message. It would ve saved me a lot of time.

问题回答

Here is a link to an article on ESRI error codes that can be used to look up an error.

The particualar error you recieved is defined as FDO_E_FIELD_NOT_FOUND, which you already figured out indicates the attempted use of a field name that is not in the table.





相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签