<?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: Add attachment to a new feature in ArcGIS for Windows Mobile Questions</title>
    <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/add-attachment-to-a-new-feature/m-p/628007#M2635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;i try this. but i get this error. it means tha the id that you said is a temporary id&amp;nbsp; so it doesnt work to create attachments, i need to make this work with only one form, i wouldnt like have to create the feature and then selected to add the file. &lt;BR /&gt;&lt;BR /&gt;[ATTACH=CONFIG]29721[/ATTACH]&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The code i showed to you is one of the project i did. It add the new feature and attachments if user choose to attach files. it woked for me. You are right on the sense that you has to create the feature in the featuresource so you can have an tempory id (actually it is a negitive number) in the map cache for you to add attachment. But you can definitely created the user experience through the code that user don't feel that way....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Dec 2013 18:43:49 GMT</pubDate>
    <dc:creator>HemingZhu</dc:creator>
    <dc:date>2013-12-10T18:43:49Z</dc:date>
    <item>
      <title>Add attachment to a new feature</title>
      <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/add-attachment-to-a-new-feature/m-p/628004#M2632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How can i add atachment to a new feature?? in the documentation says &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; Attachment attachment = new Attachment(featureSource, ID, "WaterMeter1.jpg");&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;but how to get the &lt;/SPAN&gt;&lt;STRONG&gt;id &lt;/STRONG&gt;&lt;SPAN&gt;if it is a new feature ???.&amp;nbsp; i need to add attchment on the same form .&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Nov 2013 16:02:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/add-attachment-to-a-new-feature/m-p/628004#M2632</guid>
      <dc:creator>SheridanNava</dc:creator>
      <dc:date>2013-11-28T16:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Add attachment to a new feature</title>
      <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/add-attachment-to-a-new-feature/m-p/628005#M2633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;How can i add atachment to a new feature?? in the documentation says &lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt; Attachment attachment = new Attachment(featureSource, &lt;STRONG&gt;ID&lt;/STRONG&gt;, "WaterMeter1.jpg");&lt;/PRE&gt;&lt;BR /&gt;but how to get the &lt;STRONG&gt;id &lt;/STRONG&gt;if it is a new feature ???.&amp;nbsp; i need to add attchment on the same form .&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;using the FeatureDataRow.Fid. Like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FeatureDataRow featureDataRow =featureDataTable.NewRow();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;featureDataTable.Rows.Add(featureDataRow);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;int oid =featureDataRow.Fid;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AttachmentManager manager =featureDataTable.FeatureSource.AttachmentManager;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Attachment attachment=New Attachment(featureDataTable.FeatureSource, oid, fileName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (manager.HasAttachment &amp;amp;&amp;amp; manager.AllowEdits)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; manager.AddAttachment(attachment, fileSource, FileOperation.CopyFile);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 21:01:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/add-attachment-to-a-new-feature/m-p/628005#M2633</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2013-12-09T21:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Add attachment to a new feature</title>
      <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/add-attachment-to-a-new-feature/m-p/628006#M2634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i try this. but i get this error. it means tha the id that you said is a temporary id&amp;nbsp; so it doesnt work to create attachments, i need to make this work with only one form, i wouldnt like have to create the feature and then selected to add the file. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]29721[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 14:08:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/add-attachment-to-a-new-feature/m-p/628006#M2634</guid>
      <dc:creator>SheridanNava</dc:creator>
      <dc:date>2013-12-10T14:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add attachment to a new feature</title>
      <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/add-attachment-to-a-new-feature/m-p/628007#M2635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;i try this. but i get this error. it means tha the id that you said is a temporary id&amp;nbsp; so it doesnt work to create attachments, i need to make this work with only one form, i wouldnt like have to create the feature and then selected to add the file. &lt;BR /&gt;&lt;BR /&gt;[ATTACH=CONFIG]29721[/ATTACH]&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The code i showed to you is one of the project i did. It add the new feature and attachments if user choose to attach files. it woked for me. You are right on the sense that you has to create the feature in the featuresource so you can have an tempory id (actually it is a negitive number) in the map cache for you to add attachment. But you can definitely created the user experience through the code that user don't feel that way....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 18:43:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/add-attachment-to-a-new-feature/m-p/628007#M2635</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2013-12-10T18:43:49Z</dc:date>
    </item>
  </channel>
</rss>

