If statement to check if datatable is null in C# syntax

Hi there!
I need to check in IF activity if datatable “cashData” has null value in C# syntax. I would be extremely grateful for some help.

Hello @mnos,

Welcome to UiPath community!

cashData is your data column in the datatable?.

Hi @sarathi125 !
No, cashData is my dataTable.
image

in Try Catch activity (“finally” section) I want to insert an if condition, something like if cashData is null but with C# syntax.

Hi,

Can you try as the following?

cashData == null

image

Regards,

@mnos,

Try this in your IF Activity with C# syntax,

(cashData == null && cashData.Rows.Count == 0)

Hi @yoichi, Thank you - it worked! :slight_smile:

1 Like

@sarathi125 thank you so much!

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