How to check a specific column in the datatable is blank or not


#1

how to check a specific column in the datatable is blank or not using If ACTIVITY in a For each row.Can any on help on this ASAP?


#2

Hi @krishnan,

Using if condition

Convert.tostring(row("columnname"))=""

Or
string.IsNullOrEmpty(Convert.tostring(row("columnname"))

Using linq we can get specific columns without null and empty

DataTableName.Rows.Cast(Of DataRow)().Where(Function(row) Not Convert.ToString(row.Item("columnname')).Equals(""))).CopyToDataTable()

Regards,
Arivu


#3

after checking column is blank in datatable,how do I assign a new value to the column?


#4

Hey @krishnan

Check it out:

Regards…!!
AKsh


#5

Hi @krishnan,

If you want update any value for the datatable better go to for each row and checj the condition and update it.
in side for each row
use Assign activity
row("Columnname")="value"

Regards,
Arivu


#6

I am using For each row and ,checking the condition.I want to know how to update the datatable column?


#7

Hi @krishnan,

use this code to update ,see the previous post.

use for each row activity

inside use if condition to check the value is empty or not

after that use Assign activity to update the column value.
row("ColumnName") ="your value"

Regards,
Arivu


#8

Thanks for your help.


#9

I have variable1 = 110.00(PDF) and variable 2 = 110(CSV) which are amount fields with

I want to compare variable1 = variable2.how do I do it?


Comparison amt fields with different format
#10

Hi @krishnan,

Convert.ToDouble(Variable1)= Convert.ToDouble(Variable2)

Regards,
Arivu


#11

I have variable1 12,345.00
varaiable2 = 12345
how to convert?


#12

How do I clear a string variable ?Can anyone help me?


#13

Hi @krishnan,

Use if condition to check the values are equal or not

Variable1=String.Empty

Regards,
Arivu