<?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 Adding feature to Pro feature class in hosted service in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/adding-feature-to-pro-feature-class-in-hosted/m-p/796165#M1795</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI, I am trying to add create a feature using the rowbuffer and create row functions in c#. I am using the following code to attempt creating the polyline.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using (geodb)&lt;BR /&gt; {&lt;BR /&gt; using (FeatureClass fc = geodb.OpenDataset&amp;lt;FeatureClass&amp;gt;("6"))&lt;BR /&gt; {&lt;BR /&gt; &lt;BR /&gt; RowBuffer rowBuffer = fc.CreateRowBuffer();&lt;BR /&gt; &lt;BR /&gt; rowBuffer["SHAPE"] = poly;&lt;/P&gt;&lt;P&gt;Feature feat= fc.CreateRow(rowBuffer);&lt;BR /&gt; fc.Dispose();&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; geodb.Dispose();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I receive the error&amp;nbsp;&lt;/P&gt;&lt;P&gt;A geodatabase exception has occurred.&lt;/P&gt;&lt;P&gt;on the fc.createrow&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Sep 2020 18:58:29 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2020-09-01T18:58:29Z</dc:date>
    <item>
      <title>Adding feature to Pro feature class in hosted service</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/adding-feature-to-pro-feature-class-in-hosted/m-p/796165#M1795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI, I am trying to add create a feature using the rowbuffer and create row functions in c#. I am using the following code to attempt creating the polyline.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using (geodb)&lt;BR /&gt; {&lt;BR /&gt; using (FeatureClass fc = geodb.OpenDataset&amp;lt;FeatureClass&amp;gt;("6"))&lt;BR /&gt; {&lt;BR /&gt; &lt;BR /&gt; RowBuffer rowBuffer = fc.CreateRowBuffer();&lt;BR /&gt; &lt;BR /&gt; rowBuffer["SHAPE"] = poly;&lt;/P&gt;&lt;P&gt;Feature feat= fc.CreateRow(rowBuffer);&lt;BR /&gt; fc.Dispose();&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; geodb.Dispose();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I receive the error&amp;nbsp;&lt;/P&gt;&lt;P&gt;A geodatabase exception has occurred.&lt;/P&gt;&lt;P&gt;on the fc.createrow&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Sep 2020 18:58:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/adding-feature-to-pro-feature-class-in-hosted/m-p/796165#M1795</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-09-01T18:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Adding feature to Pro feature class in hosted service</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/adding-feature-to-pro-feature-class-in-hosted/m-p/796166#M1796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jordan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any error message with the exception?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally in an ArcGIS Pro add-in it's better to use the Editor. &amp;nbsp;This adds your edit to the operation stack for undo/redo and refreshes the map. &amp;nbsp;An example of creating a feature using the Editor can be found &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase#creating-a-feature" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do want to use the low-level editing routines, perhaps because this is a CoreHost application, you should adjust your use of Dispose/using and add a transaction as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Geodatabase geodb &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ObtainGeodatabaseWithCodeYouDidntShow&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  geodb&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ApplyEdits&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
  &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;FeatureClass fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; geodb&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OpenDataset&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;FeatureClass&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"6"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;RowBuffer rowBuffer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; fc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateRowBuffer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      rowBuffer&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SHAPE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; poly&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      fc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateRow&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rowBuffer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Dispose&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;//disposes the row created by CreateRow&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// using block disposes fc and rowBuffer&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// using block disposes geodb&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="border: 0px;"&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;I hope this helps.&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:11:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/adding-feature-to-pro-feature-class-in-hosted/m-p/796166#M1796</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2021-12-12T09:11:39Z</dc:date>
    </item>
  </channel>
</rss>

