Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datatable.Select()/Datarow.Find()

Status
Not open for further replies.

RTorrance

Programmer
Apr 12, 2002
64
CA
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top