0

I have a problem with following code in vb.net

For Each Row As DataRow In DataTable
   If Row("FieldName") = vbNull Then
      MsgBox(...)
   End If
Next Row

A message error appears telling me that "=" can't be used with vbNull, I searched for a solution without any luck, any help? I just need to make something if some cell in some Row in Datatable is Null

lokusking
  • 7,396
  • 13
  • 38
  • 57
  • You didn't search very hard, google gave me the results in seconds. – Takarii Dec 01 '16 at 11:47
  • Possible duplicate of [handling dbnull data in vb.net](http://stackoverflow.com/questions/222834/handling-dbnull-data-in-vb-net) – Takarii Dec 01 '16 at 11:48

1 Answers1

0

VBA has a function IsNull()

So is should work if you use this:

If IsNull(Row("FieldName")) Then
Bojan B
  • 2,091
  • 4
  • 18
  • 26