Problem with GDB NULL values

574
1
06-20-2012 10:05 AM
DaveCouture
New Contributor III
Any idea how I can get ArcMap to stop crashing, when getting NULL attribute values, from a GDB? 

This code works, but not with NULLs:

Dim cursor As IFeatureCursor
Dim feature As IFeature
Dim taxname As Integer

cursor = featureLayer.Search(queryFilter, False)
feature = cursor.NextFeature

taxname = feature.Fields.FindField("taxname")
Me.TextBox2.Text = feature.Value(taxname)
0 Kudos
1 Reply
DaveCouture
New Contributor III
Found a solution from there: http://forums.esri.com/Thread.asp?c=93&f=985&t=84492

If (feature.Value(taxname)) Is DBNull.Value Then
    Me.TextBox2.Text = ""
Else
    Me.TextBox2.Text = feature.Value(taxname)
End If
0 Kudos