<?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: How do I obtain a NULL value from an ArcGIS.Core.Data.Row? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-obtain-a-null-value-from-an-arcgis-core/m-p/836723#M3596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gernot,&lt;/P&gt;&lt;P&gt;You can assign row value to object type variable. Then check if it is null. If not - assing it to&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;timestamp&lt;/SPAN&gt; variable as in your code.&lt;/P&gt;&lt;P&gt;Another way is to use&amp;nbsp;Convert.ToDateTime like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;DateTime timestamp&amp;nbsp; = &lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Convert.ToDateTime&lt;/SPAN&gt;(row["Timestamp"]);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2020 14:10:45 GMT</pubDate>
    <dc:creator>GKmieliauskas</dc:creator>
    <dc:date>2020-04-08T14:10:45Z</dc:date>
    <item>
      <title>How do I obtain a NULL value from an ArcGIS.Core.Data.Row?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-obtain-a-null-value-from-an-arcgis-core/m-p/836722#M3595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do I obtain a NULL value from an ArcGIS.Core.Data.Row?&lt;/P&gt;&lt;P&gt;I have a nullable field "Timestamp" in the Database.&lt;/P&gt;&lt;P&gt;When I iterate using a RowCursor, I can find no way to obtain that NULL value using the ArcGIS Pro SDK for DotNet.&lt;/P&gt;&lt;P&gt;I get a valid Row object and I can access all the other fields using the Indexer, just not the NULL field!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;while(cursor.MoveNext()) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
  Row row = cursor.Current;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
  DateTime timestamp&amp;nbsp; = (DateTime)row["Timestamp"];&amp;nbsp; //Works only if not NULL. Throws NullReferenceException otherwise
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:59:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-obtain-a-null-value-from-an-arcgis-core/m-p/836722#M3595</guid>
      <dc:creator>GernotNeppert</dc:creator>
      <dc:date>2021-12-12T16:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I obtain a NULL value from an ArcGIS.Core.Data.Row?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-obtain-a-null-value-from-an-arcgis-core/m-p/836723#M3596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gernot,&lt;/P&gt;&lt;P&gt;You can assign row value to object type variable. Then check if it is null. If not - assing it to&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;timestamp&lt;/SPAN&gt; variable as in your code.&lt;/P&gt;&lt;P&gt;Another way is to use&amp;nbsp;Convert.ToDateTime like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;DateTime timestamp&amp;nbsp; = &lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Convert.ToDateTime&lt;/SPAN&gt;(row["Timestamp"]);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2020 14:10:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-obtain-a-null-value-from-an-arcgis-core/m-p/836723#M3596</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2020-04-08T14:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I obtain a NULL value from an ArcGIS.Core.Data.Row?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-obtain-a-null-value-from-an-arcgis-core/m-p/836724#M3597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gintautas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks very much for your quick reply. That solved the problem for me!&lt;/P&gt;&lt;P&gt;I have to admit I didn't take into account that, in DotNet, a cast from null to another type can actually fail - if that type is a struct!&lt;/P&gt;&lt;P&gt;I guess that programming Java for 20+ years has spoiled me somehow &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gernot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2020 05:59:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-obtain-a-null-value-from-an-arcgis-core/m-p/836724#M3597</guid>
      <dc:creator>GernotNeppert</dc:creator>
      <dc:date>2020-04-09T05:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I obtain a NULL value from an ArcGIS.Core.Data.Row?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-obtain-a-null-value-from-an-arcgis-core/m-p/836725#M3598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used the following snippet to check if a column value of a Row is null:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;  &lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; field &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; fields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;val &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; DBNull &lt;SPAN class="operator token"&gt;||&lt;/SPAN&gt; val &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;continue&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="punctuation token"&gt;}&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the code is used in this sample:&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/blob/2d6a30e2597c7a0079ae65b182f60a77e79aaef7/Map-Exploration/CustomPopup/CustomPopupTool.cs" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/blob/2d6a30e2597c7a0079ae65b182f60a77e79aaef7/Map-Exploration/CustomPopup/CustomPopupTool.cs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The sample has to ignore null columns.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:09:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-obtain-a-null-value-from-an-arcgis-core/m-p/836725#M3598</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-12-12T10:09:40Z</dc:date>
    </item>
  </channel>
</rss>

