find datarow matching criteria
Posted on 2006-06-26
Hi, I am using dataTables and need to find records matching a specific criteria in Access. I keep getting an error message saying that the table has no primary key. This is not the case as there is a primary key, called materialID.
Here is the code.
dbCommand.Connection = dbConnection
dbCommand.CommandType = CommandType.Text
dbCommand.CommandText = "Select * from material"
da.SelectCommand = dbCommand
' i get an error message here saying there's no primary key on the table.
ColbondRate = Convert.ToSingle(dr("Rate"))
Catch ex As Exception
MsgBox("Could not find Colbond Rate")