I have a DataTable that I create by using the TextFieldParser against a txt file I want to keep that Table but I also want to create another table from the same file minus the rows where a certain field is empty.
I am not sure what the BEST way to accomplish this is. I thought of a function that would return a NewTable ?
I am struggling to see what I am doing wrong, thought I would put up a post while I continue to google about functions and other possible solutionsCode:Private Function EditTable(ByVal Table As DataTable) As DataTable For i As Integer = Table.Rows.Count - 1 To 0 Step -1 Dim row As DataRow = Table.Rows(i) If row.Item(0) Is Nothing Then Table.Rows.Remove(row) ElseIf row.Item(0).ToString = "" Then Table.Rows.Remove(row) End If Next Return NewTable End Function




Reply With Quote