开发者

Edit data and save back to database

开发者 https://www.devze.com 2023-01-28 12:00 出处:网络
I just need to edi开发者_如何学JAVAt one field on a datarow and save the changes back to the database.

I just need to edi开发者_如何学JAVAt one field on a datarow and save the changes back to the database. My database is SQL Compact 3.5

I tried many methods but change is not saved to database. Could you give me code example please?

Please help.

Me.taSet.Fill(Me.Dsset.tblQuestions) 
Dsset.tblQuestions.Rows(1).BeginEdit() 
Dsset.tblQuestions.Rows(1).Item("ExamID") = "EDITED"
Dsset.tblQuestions.Rows(1).AcceptChanges() 
taSet.Update(Dsset.tblQuestions)


Remove the following line from your code :

Dsset.tblQuestions.Rows(1).AcceptChanges() 

When you call AcceptChanges(), you mark that row as clean (which means this row has not been edited). That is why it does not get upodated.

0

精彩评论

暂无评论...
验证码 换一张
取 消