datagrid

G

Guest

Hi guys

I want to e able to delete rows from a datagrid and the same rows must be
deleted from the datasource of the datagrid. I have a buon that removes a row
based on a field value that is listed in a list box. here is te code:
Dim tbl As New DataTable("DATAdemo")
tbl = Me.DataSet1.Tables(0)
Dim a As Integer

For a = 0 To ListBox1.Items.Count
tbl.Rows.RemoveAt([a])
Me.OleDbDataAdapter1.Update(tbl)
Me.Refresh()
ListBox1.Items.Clear()
Next

Can somebody modify my code to accomplish my mission?
Thanx
 

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