I have a table ("checkout") that I'm tracking equipment checkout
transaction. It has columns: checkoutid (key), checkedbyid,
checkedtoid, dateout, datein and inventoryid. When the user scans an
equipment barcode (Entry), I'm trying to check if that equipment was
previously checked out, but not properly checked back in by looking up
the inventoryid and then searching for a blank datein field. I've
declared the dataview with:
Dim dvChk As New Data.DataView(InventoryDS.Tables("checkout"), "",
"inventoryid, datein", DataViewRowState.CurrentRows)
dvChkRow is an integer to represent the row in the dataview that
matches my search criteria below:
dvChkRow = dvChk.Find(New Object() {Entry.Trim, System.DBNull.Value})
The problem is, when I'm testing my code and I have a good dateout /
datein for a particular inventoryid and I fault-insert a bad one
(dateout, blank datein), dvChkRow always returns the first row in the
dataview, regardless of the presense or absence of a datein value.
I think it's something with my Find method, but I'm not exaclty sure
how to search for a null.
Regards,
Michael Banks