Identify empty cells in DataTable


I have an Excel spreadsheet with two columns.

  1. The individual cells of the columns are not always filled. The content is always numeric (double).

I write these values into a DataTable.

The two columns are to be transferred to a second DataTable subject to two conditions.
Condition 1: Column 1 is not empty and column 2 is empty.

I tried the following:
In a For Each Row activity an If statement with the condition:
Record(0) >= 0 and Record(1) = IsEmpty
Then Message Box (“Bla”)
Else Message Box (“Blub”)

Unfortunately, the condition does not work. Is there a solution?

Translated with DeepL Translate: The world's most accurate translator


try with this condition and check once,

Record(0) >= 0 AndAlso Record(1).Equals(DBNull)

Hi , inside for each row use
2 Get row item activities for 2 columns with outputs as string variables ex:Var1 for column1 , Var2 for column 2
Now use if condition

And write condition as
Not String.isnullorempty(var1) and string.isnullorempty(var2)
Message box(“Bla”)
Message box (“Blub”)

I’m getting an error message.

The workflow has validation errors. Review and resolve them first.

Compiler error(s) encountered processing expression “Datensatz(8) >= 0 AndAlso Datensatz(10).Equals(DBNull)”.
“Option Strict On” does not allow operands of type “Object” for the >= operator.
“DBNull” is a type and cannot be used as an expression.


Check with this,

Datensatz(8) >= 0 AndAlso String.IsNullOrEmpty(Convert.ToString( Datensatz(10)))

This works for me:

dt(8).ToString <> Nothing and dt(10).ToString = Nothing

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.