<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230620#M6001</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, I just tried it on a table that had both a table join and a relate and it worked fine.&amp;nbsp; It shouldn't matter though because the ITable reference returned by IStandAloneTable.Table is a reference to the actual table in the geodatabase, which will not be aware of any joins or relates.&amp;nbsp; If you want, you can attach the geodatabase you're using and I'll try to run my code against your data.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Mar 2011 16:51:09 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2011-03-08T16:51:09Z</dc:date>
    <item>
      <title>InsertRow on Cursor returns error after stopping an EditOperation and Start a new one</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230609#M5990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i am trying to migrate Code from AG 9.3 with VS 2005 to AG 10 with VS 2010. In AG 10 i have the following Problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'I create a reference to a FeatureTable and Cursor: (this is done outside of the edit session)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FLSTSLnkTable = DBConnection.newpGDBCon.GetFeatureTable("w_Lnk_FLS_TS")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FLSTSLnkCursor = FLSTSLnkTable.Insert(False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'After that I start the EditSession and an Editoperation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;aoiWorkspaceEdit.StartEditing(True)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aoiWorkspaceEdit.StartEditOperation()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'in this EditOperation i use the InsertRow into the FeatureTable via the cursor and rowbuffer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim myRowBuffer As IRowBuffer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myRowBuffer = FLSLnkTable.CreateRowBuffer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim myRow As IRow&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myRow = myRowBuffer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; With myRow&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Value(.Fields.FindField(LnkFLSIdName)) = FeatFeldId&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Value(.Fields.FindField(LnkSonstIdName)) = Me.ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Value(.Fields.FindField("Flaechenanteil")) = myIntersectArea / 10000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FLSLnkCursor.InsertRow(myRowBuffer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Catch ex As Exception&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(ex.Message, MsgBoxStyle.Critical)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Try&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'then i stop the edit operation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;aoiWorkspaceEdit.StopEditOperation()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'after that i start a new EditOperation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;aoiWorkspaceEdit.StartEditOperation()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'and then i try to insert another row into the FeatureTable via the cursor and rowbuffer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and here i get the following error when it comes to the line "FLSLnkCursor.InsertRow(myRowBuffer)":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"The cursor has been invalidated because the edit operation has stopped."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In ArcGIS 9.3 this worked fine. Is there a change in which order i do the reference to the objects in ArcGIS 10? Does someone have a hint how to deal with this error?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greetings Karin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2011 09:15:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230609#M5990</guid>
      <dc:creator>karinweixler</dc:creator>
      <dc:date>2011-03-02T09:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230610#M5991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;one more thing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried it also to create the reference of the cursor inside of the EditOperation as it is said in the help (if i understand that one right). But then i get the following error message on the line "FLSLnkCursor.InsertRow(myRowBuffer)":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Error HRESULT E_FAIL has been returned from a call to a COM component."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can remember this was also the point with ArcGIS 9.3 and the reason i put the Cursor outside of the editsession.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 07:02:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230610#M5991</guid>
      <dc:creator>karinweixler</dc:creator>
      <dc:date>2011-03-03T07:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230611#M5992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In your call to StartEditing you're specifying that you want undo/redo capability.&amp;nbsp; Unless you're implementing this functionality I would pass in False.&amp;nbsp; Is there any reason why you need to enclose each edit in its own operation?&amp;nbsp; If not, then just use a single operation - start editing, start operation, perform all edits, stop operation, stop editing.&amp;nbsp; I can't say that I've ever tried to use the same cursor in multiple operations.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 12:29:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230611#M5992</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-03-03T12:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230612#M5993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Neil for your reply. Yes the undo/redo function i would like to implement, because it is a very nice feature. Well the thing is that everything worked in ArcGIS 9.3 and it is always hart to explain to the user, why he will not have this feature in the new version.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 12:45:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230612#M5993</guid>
      <dc:creator>karinweixler</dc:creator>
      <dc:date>2011-03-03T12:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230613#M5994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you want undo/redo functionality then you will probably have to get a new cursor for each edit.&amp;nbsp; I don't know for sure, but it could be that operations cannot be supported inside the same cursor.&amp;nbsp; That kind of makes sense when you think about it.&amp;nbsp; Cursors in ArcObjects are forward-only so how do you go back and undo an edit?&amp;nbsp; The solution is probably to just dump the whole cursor.&amp;nbsp; This may have been a bug that ESRI fixed.&amp;nbsp; For instance, the definition of a shapefile requires that the attribute table have at least one field (the FID and Shape fields don't count because they aren't stored in the .dbf file).&amp;nbsp; This is why you always have that Id field when you create a shapefile through ArcCatalog and you can't delete it unless you add another field.&amp;nbsp; At one time, you could create a shapefile through code with no attribute fields even though that was a violation of the shapefile definition.&amp;nbsp; ESRI eventually fixed this bug and now you can't do that.&amp;nbsp; The side effect of this bug fix is that it broke a lot of (incorrect) code.&amp;nbsp; This may be the case here with your code.&amp;nbsp; Again, that's just a theory.&amp;nbsp; Try getting a new cursor for each edit and see if that fixes the problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 12:54:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230613#M5994</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-03-03T12:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230614#M5995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks again. But this is exactly the problem i have: i can not get a reference to the cursor inside the editoperation, because then i get the HRESULT E_FAIL error message (second post). As it looks the error is thrown because the Table in which the row should be inserted, has some relationsships that are not from the ObjectId of the Table to another Table. If I delete those relationships sometimes (not in every case) the reference inside of the editoperation is working. But this would be a big change in my Database and also in the code. So i really hope there is a different way getting this work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 13:05:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230614#M5995</guid>
      <dc:creator>karinweixler</dc:creator>
      <dc:date>2011-03-03T13:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230615#M5996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can't you get a new cursor in between the call to StopOperation for one edit and the call to StartOperation for the next edit?&amp;nbsp; You don't have to stop the edit session as the error seems to be complaining about the operation, not the session.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 17:04:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230615#M5996</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-03-03T17:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230616#M5997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unfortunately i always get the "Error HRESULT E_FAIL has been returned from a call to a COM component" if i put the reference for the Cursor inside of the Editsession. Even if i dont use the Undo/Redo function and the EditOperation. Can this be a bug in ArcMap, or is the curser just not made for tables with relationships? Or am i doing something wrong? I tried it with get the reference to the table also inside the editsession and one time oustside of the editsession, same result.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2011 06:38:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230616#M5997</guid>
      <dc:creator>karinweixler</dc:creator>
      <dc:date>2011-03-04T06:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230617#M5998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't have any problems executing the following code.&amp;nbsp; Maybe you'll see something that you're doing differently.&amp;nbsp; Let me know how it goes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim mxDocument As IMxDocument = DirectCast(m_application.Document, IMxDocument)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim map As IMap = mxDocument.FocusMap
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim standaloneTableCollection As IStandaloneTableCollection = DirectCast(map, IStandaloneTableCollection)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim standAloneTable As IStandaloneTable = standaloneTableCollection.StandaloneTable(0)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim table As ITable = standAloneTable.Table
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim dataset As IDataset = DirectCast(table, IDataset)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim workspace As IWorkspace = dataset.Workspace
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim workspaceEdit As IWorkspaceEdit = DirectCast(workspace, IWorkspaceEdit)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not workspaceEdit.IsBeingEdited Then workspaceEdit.StartEditing(True)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workspaceEdit.StartEditOperation()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim insertCursor As ICursor = table.Insert(True)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim rowBuffer As IRowBuffer = table.CreateRowBuffer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim index As Int32 = table.Fields.FindField("scenario_id")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rowBuffer.Value(index) = "test scenario"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oid As Int32 = Convert.ToInt32(insertCursor.InsertRow(rowBuffer))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workspaceEdit.StopEditOperation()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Marshal.ReleaseComObject(insertCursor)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Marshal.ReleaseComObject(rowBuffer)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workspaceEdit.StartEditOperation()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insertCursor = table.Insert(True)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rowBuffer = table.CreateRowBuffer()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rowBuffer.Value(index) = "test scenario"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insertCursor.InsertRow(rowBuffer)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workspaceEdit.StopEditOperation()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Marshal.ReleaseComObject(insertCursor)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Marshal.ReleaseComObject(rowBuffer)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workspaceEdit.StopEditing(True)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show(ex.ToString)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:12:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230617#M5998</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2021-12-11T11:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230618#M5999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looking at the original code posted, I noticed you have a try/catch block inside the operation.&amp;nbsp; That is fine but when you catch an exception you should stop or abort the edit operation, if you don't you will leave a dangling edit operation which could result in a error the next time through.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2011 20:12:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230618#M5999</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2011-03-04T20:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230619#M6000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, I tried it like you and put the Table (which comes from a PGDB) into the map and make the reference to the table from the standalonetablecollection. Same result --&amp;gt; the HRESULT E_FAIL. Have you tried it with a table which has relations to other tables or featureclasses?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2011 16:34:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230619#M6000</guid>
      <dc:creator>karinweixler</dc:creator>
      <dc:date>2011-03-08T16:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230620#M6001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, I just tried it on a table that had both a table join and a relate and it worked fine.&amp;nbsp; It shouldn't matter though because the ITable reference returned by IStandAloneTable.Table is a reference to the actual table in the geodatabase, which will not be aware of any joins or relates.&amp;nbsp; If you want, you can attach the geodatabase you're using and I'll try to run my code against your data.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2011 16:51:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230620#M6001</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-03-08T16:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230621#M6002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Neil, I have attachet the PGDB. You could try it with the table 'w_Lnk_FLS_TS'. This table has a relation to the FC 'w_Dat_Teilschlag' (Id_Teilschlag - ObjectId) and a relation to the FC 'w_Dat_Flurstueck' (Id_Flurstueck - ObjectId). Tank you for your great help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 17:32:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230621#M6002</guid>
      <dc:creator>karinweixler</dc:creator>
      <dc:date>2011-03-09T17:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230622#M6003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I haven't had much time to look at this but when I try to add a new record to the table using the ArcMap Editor I get an error saying there must be a record in a related table.&amp;nbsp; I tried using an ObjectId from the related feature class and still got the same error.&amp;nbsp; Are you able to add records to this table in ArcMap?&amp;nbsp; If so, do you still get the error using those same attribute values in your code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 20:29:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230622#M6003</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-03-09T20:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: InsertRow on Cursor returns error after stopping an EditOperation and Start a new</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230623#M6004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to add a new record in ArcMap during a Editsession to the Table, and I also get the error, that there must be a related ObjectId in the related FC, even if i take an ObjectId which is in both of the tables. So i guess ArcMap has a problem with relation done in ACCESS?! This doesen't sound very nice. Is this a known constraint in ArcMap or a bug? Thanks a lot for your time and help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2011 17:29:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/insertrow-on-cursor-returns-error-after-stopping/m-p/230623#M6004</guid>
      <dc:creator>karinweixler</dc:creator>
      <dc:date>2011-03-10T17:29:02Z</dc:date>
    </item>
  </channel>
</rss>

