Dataset changed but won't update.

  • Thread starter Thread starter Rico
  • Start date Start date
R

Rico

I have a pretty simple block of code here that won't work. I've looped
through the rows, and reviewed the values and the dataset values change fine
but it's not updating to the database and doesn't throw an exception. Has
anyone run into this before?

sql = "SELECT * FROM INVENTORY WHERE Inventory_ID=" & InvId
da = mdi.dt.GenericDA(sql)
da.UpdateCommand = mdi.dt.GenericDACommand("UPDATE INVENTORY Set
Amount_Paid=@Amount_Paid WHERE Inventory_ID=" & InvId)
da.UpdateCommand.Parameters.Add("@Amount_Paid", OleDb.OleDbType.Currency, 8,
"Amount_Paid")

ds.Tables.Add("Inventory")
da.Fill(ds.Tables("Inventory"))

da.UpdateCommand.Parameters("@Amount_Paid").Value = 12

da.Update(ds, "Inventory")
 
Back
Top