0

Good day folks,

I want to delete some records in my datatable using query. But I don't know how to do it. Can someone help me? Thanks

        For i As Integer = 0 To objChkArray.Count - 1
            Dim rows As DataRow() = dtable.[Delete]("ct = '" & CInt(objChkArray(i)) & "'")
            For Each row As DataRow In rows
                dtable.ImportRow(row)
            Next
        Next
2
Contributors
4
Replies
30
Views
5 Years
Discussion Span
Last Post by GeekPlease
0

I think it probably the same. You can change "Ct='abc'" with your query and "Ct" with your sorting column.

        Dim Dr() As DataRow
        Dr = dt.Select("ct = 'abc'", "ct")
        For i As Integer = 0 To Dr.Length - 1
            dt.Rows.Remove(Dr(i))
        Next
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.