Refresh SQL Server Native Client after renaming a Field?

2856
3
05-29-2013 08:31 AM
MickeyO_Neil
New Contributor III
Hello,

I renamed a Field of a FeatureClass in an ArcSDE with the IClassSchemaEdit4.AlterFieldName Method.
This works fine, but as soon as I create a Cursor to iterate the FeatureClass I get an SQL Server Native Client Error, which can't find the old(!!) Fieldname in the Database.
m_pCursor = pFeatureClass.Search(Nothing, False)


But if i look for the renamed Field in the FeatureClass everything is fine --> I can't find the old fieldname and the new one is there.

I have no idea why the Native Client is looking for the old Fieldname? Do I have to refresh the Client somehow?

If I restart my application or look at the FeatureClass with ArcCatalog everything works fine.

Any idea whats going on with the Microsoft SQL Server Native Client 10.0?

Thanks
Mickey
0 Kudos
3 Replies
AndryJoos
Occasional Contributor

We're currently encountering a similar issue. Have you ever found a resolution to this problem?

0 Kudos
MickeyO_Neil
New Contributor III

You have to reconnect to the Workspace, and look for the Feature-Class, again. Then only use the new FC-Object and dispose the old one.

0 Kudos
AndryJoos
Occasional Contributor

Hi Mickey, thanks for your answer. While this would resolve the problem, it does not work for us in a performance critical environment where reconnecting to the workspace is not an option. We have, while exploring workarounds, found a way to avoid our original problem. Thanks!

0 Kudos