DataRow Remove problem

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

My code is so simple that I want to remove the row. However, After process
the below code, I browse the table, nothing is deleted.

dtRemark.DefaultView.RowFilter = "cocode ='ABC'"
Dim myDataRow As DataRow
myDataRow = dtRemark.DefaultView.Item(0).Row
dtRemark.Rows.Remove(myDataRow)

dtRemark.acceptchanges()
dsRemark.update()
daRemark.Update(dsRemark, "CompanyRemark")
dsRemark.AcceptChanges()
 
is daRemark your data adapter? Have you built the Update, Insert, and Delete
strings for the data adapter?

Personally I never liked using the DataAdapter to do anything more than
fetch my data. I alwas update data with my own SQL code that I execute on
the connection object... but that's just me! :-)
 
Back
Top