Saturday 22 August 2015

arcgis 10.0 - Null values in plugin data source


How do you appropriately setup a plugin data source to allow for null values (in .NET - C# preferred)?


I'm currently setting up a field using:


field.Type_2 = esriFieldType.esriFieldTypeSingle;
field.IsNullable_2 = true;
field.Name_2 = "Foo";

Then, later, during the cursor's QueryValues call, I'm trying to set a null value via:


// Given: public int QueryValues(IRowBuffer row)

row.Value[i] = null;

However, the value always maps through as 0, not null. How do you properly setup the data source in a plugin data source to allow for a null value?



Answer



Have you tried setting DBNull.Value instead of null?


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...