datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Back
Top