DataRow Remove problem

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()
 
G

Guest

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! :)
 

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