Thanks for all the suggestions, McMurdoStation, I considered them all but I was also using this data for filling other thing which I would like to keep the nulls and I would to change the minimum amount of code possible so I took a different approach. Instead
of removing the null rows I selectively added rows that were not null. Here is my solution:
ipList = ds.Tables("RouterIPs").Clone
'add only non-null ip_addr dropdownlist view
Dim i As Integer
Dim dr As DataRow
For i = 0 To (ds.Tables("RouterIPs").Rows.Count - 1)
If Not ds.Tables("RouterIPs").Rows(i).Item("IP_Addr") Is DBNull.Value Then
ipList.ImportRow(ds.Tables("RouterIPs").Rows(i))
End If
Next
nickicl
Star
8230 Points
1646 Posts
Re: remove null rows in data table
Aug 13, 2003 04:45 PM|LINK
ipList = ds.Tables("RouterIPs").Clone 'add only non-null ip_addr dropdownlist view Dim i As Integer Dim dr As DataRow For i = 0 To (ds.Tables("RouterIPs").Rows.Count - 1) If Not ds.Tables("RouterIPs").Rows(i).Item("IP_Addr") Is DBNull.Value Then ipList.ImportRow(ds.Tables("RouterIPs").Rows(i)) End If Next