Dataset changed but won't update.

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top