As stated in the question only
Id
is the primary key in
OrderDetail
and
idProduct
is another id.
Hence, I think the
Select
method of
DataTable
can be used to find the required row as follows:
DataRow[] rows = tbCart.Select(
string.Format("id='{0}' and idProduct='{1}'",id,idProduct),
idProduct, DataViewRowState.CurrentRows);
if (rows.Length > 0){
rows[0]["quantity"]=
rows[0]["price"]=
}