Reputation: 745
I'm trying to save a null in an integer column with arcObjects but it always save 0 when the value is null. Can anyone explain me what is happening? I am developing in C#.
I tried to assign DBNull.Value to my variable but I can't because it's an integer. Thank you very much for your time and your knowledge!
Visual Studio side:
ArcGIS side:
Upvotes: 0
Views: 773
Reputation: 21
Shapefile does not support Null in field value and converts it to default value ie 0 for integer types. In a Geodatabase, the field "Allow NULL values" property should be set to "Yes".
Upvotes: 0
Reputation: 81
U need DBNull
... = (entry.Value == null) ? DBNull.Value : entry.Value;
Upvotes: 2