How to check if a column in a data table has any values or not. I have tried the
-
dt.Select(“colname is null”)
-
Any() method
Need to check if the column has any values or is it empty before proceeding for each loop
How to check if a column in a data table has any values or not. I have tried the
dt.Select(“colname is null”)
Any() method
Need to check if the column has any values or is it empty before proceeding for each loop
Hi @PD2
Dt.Select("columnname <> '' or columnname is not null")
LINQ
Dt.Rows.Cast(Of DataRow)().Where(Function(row) Not (row("columnname") Is DBNull.Value Or Convert.Tostring(row("columnname")).Trim.Equals(""))).CopyToDataTable()
Or
variable4.AsEnumerable.Where(Function(row) row("columnname") is DBNull.Value or Convert.Tostring(row("columnname")).Trim = "").CopyToDataTable
Regards,
Arivu
very good solution, thanks
Where should I put these expressions? I can’t place them into decision activity because they are not Boolean