I'm populating a listbox with values from a column in a layer.
Sometimes the layer could be from a .shp and other times it could be from a File GeoDb.
Here's my current code:
Dim x,NumberOfRows as Integer
NumberOfRows = theTable.GetRows.Count
x = 1
While (x < theNumberofRows)
r = theTable.GetRow(x)
values = r.Values
Listbox1.Items.Add(values(theField).ToString)
End While
As a result of the code above if I had identical .shp & FileGeoDb containing 4 records
The .Shp would give values for records 2,3,4
The FileGDb would give values for records 1,2,3
If I use (x <= theNumberOfRows):
The FileGDb works fine, but crashes on .Shp's
Essentially, I believe one table is zero based and the other starts at 1. So how do I check to see what the format of the layer is to correct the counter to adjust accordingly??