>I have data from and excel file in a datatable dt.
>I know the start of my real data is the header "Resp". I have a few blank lines that come across as System.dbnull
>
>What is wrong with this if line, that it barfs on a System.dbnull value?
>
> If (dr(0) = "Resp" & Not IsDBNull(dr(0))) Then Exit For
Ok, I broke them apart.
For Each dr As DataRow In dt.Rows
If (IsDBNull(dr(0))) Then
dr.Delete()
Else
If (dr(0) = "Resp") Then Exit For