Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB.NET and the Null blues
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01168077
Message ID:
01168082
Views:
11
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform