<?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 A &amp;amp;lt;Null&amp;amp;gt; Coded Value? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120194#M3148</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;BR /&gt;&lt;SPAN&gt;I'm looking for some help in setting a value to &amp;lt;Null&amp;gt;. I have a field in a table of type Long and it is a coded value domain. In ArcMap I am able to assign a value of &amp;lt;Null&amp;gt; to the field and save it without error. I'd like to be able to do this programmatically. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I assign a &amp;lt;Null&amp;gt; to a Long data type in code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp; row.set_Value(FIELD INDEX, WHAT GOES HERE?);
&amp;nbsp; cur.UpdateRow(row);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt;G&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2011 13:44:46 GMT</pubDate>
    <dc:creator>GregRieck</dc:creator>
    <dc:date>2011-08-17T13:44:46Z</dc:date>
    <item>
      <title>A &amp;lt;Null&amp;gt; Coded Value?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120194#M3148</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;BR /&gt;&lt;SPAN&gt;I'm looking for some help in setting a value to &amp;lt;Null&amp;gt;. I have a field in a table of type Long and it is a coded value domain. In ArcMap I am able to assign a value of &amp;lt;Null&amp;gt; to the field and save it without error. I'd like to be able to do this programmatically. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I assign a &amp;lt;Null&amp;gt; to a Long data type in code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp; row.set_Value(FIELD INDEX, WHAT GOES HERE?);
&amp;nbsp; cur.UpdateRow(row);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt;G&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 13:44:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120194#M3148</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2011-08-17T13:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: A &lt;Null&gt; Coded Value?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120195#M3149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just a quick shot, but have you tried Nullable(Of Integer)?&amp;nbsp; The problem is that in VB, Integers cannot be null (at least that's what I believe).&amp;nbsp; Setting your Integer variable to "Nothing" would only produce the default value of 0(zero).&amp;nbsp; But the Integer? Type should get you the result you want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; Dim myIntValue As Integer? = Nothing
&amp;nbsp; row.set_Value(FIELD INDEX, myIntValue);
&amp;nbsp; cur.UpdateRow(row);
&lt;/PRE&gt;&lt;SPAN&gt;G&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm looking for some help in setting a value to &amp;lt;Null&amp;gt;. I have a field in a table of type Long and it is a coded value domain. In ArcMap I am able to assign a value of &amp;lt;Null&amp;gt; to the field and save it without error. I'd like to be able to do this programmatically. &lt;BR /&gt;&lt;BR /&gt;How do I assign a &amp;lt;Null&amp;gt; to a Long data type in code?&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; row.set_Value(FIELD INDEX, WHAT GOES HERE?);
&amp;nbsp; cur.UpdateRow(row);
&lt;/PRE&gt;G&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:59:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120195#M3149</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T06:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: A &lt;Null&gt; Coded Value?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120196#M3150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the response. Yes, I have tried all sorts of Nullable type implementations and they have not worked. I find it odd that a Coded Value Domain always presents with a "&amp;lt;Null&amp;gt;" option and allows you to assign it. Also, I do not have any defined coded value of "Null" and it still allows me to update the field to Null in ArcMap. So, I'm assuming there has to be a way to accomplish this in code, correct? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some Examples...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Int? num = null;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Long? num = null;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bool? b =null;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Object obj = b;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 15:04:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120196#M3150</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2011-08-17T15:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: A &lt;Null&gt; Coded Value?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120197#M3151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I figured this out! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Turns out it had nothing to do with NULL. The problem was that the cursor was initialized as a SEARCH cursor but being used as an UPDATE cursor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;WRONG:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
ICursor cur = Tab.Search(queryfilter, false);
row.set_Value(FIELD INDEX, WHAT GOES HERE?);&amp;nbsp;&amp;nbsp; 
cur.UpdateRow(row);
&lt;/PRE&gt;&lt;SPAN&gt;CORRECT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
ICursor cur = Tab.Update(queryfilter, false);
row.set_Value(FIELD INDEX, DBNull.Value);&amp;nbsp;&amp;nbsp; 
cur.UpdateRow(row);
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:59:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120197#M3151</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2021-12-11T06:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: A &lt;Null&gt; Coded Value?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120198#M3152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does anyone know how to accomplish this in Java?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried null, "Null", etc. It seems that Java does not have a System.DBNull.Value like C# does. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I set the value of a field to null in my code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 18:09:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120198#M3152</guid>
      <dc:creator>MichaelHoward1</dc:creator>
      <dc:date>2011-09-08T18:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: A &lt;Null&gt; Coded Value?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120199#M3153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not Java but google is &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://bleu.west.spy.net/~dustin/spyjar/doc/2/net/spy/db/DBNull.html"&gt;http://bleu.west.spy.net/~dustin/spyjar/doc/2/net/spy/db/DBNull.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;does it help?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 20:28:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/a-amp-lt-null-amp-gt-coded-value/m-p/120199#M3153</guid>
      <dc:creator>DubravkoAntonic</dc:creator>
      <dc:date>2011-09-08T20:28:04Z</dc:date>
    </item>
  </channel>
</rss>

