Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 352
  • Last Modified:

how to delete a row from a datatable

I currently want to delete a row from a datatable. I am identiyiny the row by using the find method on a item in a listbox. Can someone tell me how i can delete the row from the datatable dtheldbatch


            Dim dr As DataRow = dtHeldBatch.Rows.Find(ListBoxPostBatch.ValueMember)
0
anwarmir
Asked:
anwarmir
1 Solution
 
JAMUCommented:
Hi,

after you have identified the row u can delete it like eg.

Dim dt As New DataTable
 dt.Rows(0).Delete()

This should work fine.

--JAMU--
0
 
arif_eqbalCommented:
Just say
dr.Delete
that's it

Since the DR points to the particular Row in your dataTable dtHeldBatch, a dr.delete will actually delete the row from the DataTable dtHeldBatch
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now