AnsweredAssumed Answered

Intermittent geodatabase exception from mapservice layer cursor

Question asked by luke.coursey on Jun 14, 2018
Latest reply on Jun 15, 2018 by RRuh-esristaff

I have a bit of SDK functionality that creates a featurelayer from a mapservice uri and then queries the layer for a search string using layer.Search(queryFilter) to retrieve a rowcursor, and then loops through the rowcursor to retrieve values using while (cursor.MoveNext())

 

This works most of the time but I occassionally get a geodatabase exception when calling MoveNext()

 

ArcGIS.Core.Data.GeodatabaseException: 'A geodatabase exception has occurred.'

COMException: Bad variable type. (Exception from HRESULT: 0x80020008 (DISP_E_BADVARTYPE))

at ArcGIS.Core.Data.RowCursor.MoveNext()

 

Any ideas what could be causing this error? The same bit of code works perfectly for local layer files.

Outcomes