Hello,
I am having trouble searching a table in a database on a field that is indexed but not the primary key. It always says that the value I am searching for is not found. I have tried using the Datatable.Select() method as well as the Datarow.find method. I need to search my table for a serial number and if the serial number is not there it needs to be added, otherwise updated.
Dim tblItemLabel As DataTable
tblItemLabel = dsVBBridge.Tables("ItemLabel"
'Obtain a new DataRow object from the DataTable
Dim drCurrent As DataRow '= dsVBBridge.Tables(0).NewRow
Try
drCurrent = tblItemLabel.Select("Serial_ID = " & SerialNo)(0)
This is the code that I have tried most recently. (SerialNo is a variable)
Any help would be appreciated.
Thanks
Rachael
I am having trouble searching a table in a database on a field that is indexed but not the primary key. It always says that the value I am searching for is not found. I have tried using the Datatable.Select() method as well as the Datarow.find method. I need to search my table for a serial number and if the serial number is not there it needs to be added, otherwise updated.
Dim tblItemLabel As DataTable
tblItemLabel = dsVBBridge.Tables("ItemLabel"
'Obtain a new DataRow object from the DataTable
Dim drCurrent As DataRow '= dsVBBridge.Tables(0).NewRow
Try
drCurrent = tblItemLabel.Select("Serial_ID = " & SerialNo)(0)
This is the code that I have tried most recently. (SerialNo is a variable)
Any help would be appreciated.
Thanks
Rachael