Created
August 12, 2008 20:19
-
-
Save batasrki/5144 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Function RemoveEmptyRows(ByVal dt As DataTable) As DataTable | |
Dim rowIndexes As New ArrayList | |
Dim changed As New DataTable | |
dt.AcceptChanges() | |
For i As Integer = 0 To dt.Rows.Count - 1 | |
If dt.Rows(i).Item(2).ToString = String.Empty Then | |
rowIndexes.Add(i) | |
End If | |
Next | |
For Each index As Integer In rowIndexes | |
dt.Rows(index).Delete() | |
Next | |
dt.AcceptChanges() | |
changed = dt.Copy | |
Return changed | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment