In the DataTbale i want to check the "First Column" is null or empty and then if the Fisrt column some rows are empty, copy the "Second Column" col data as same in "Fisrt Collumn"

In the DataTable i want to check the “First Column” is null or empty and then if the First column some rows are empty, copy the “Second Column” col data as same in “First Column”

DataTable like this

image

I want a output like this:

image

@krishnapriya_Anu

dt.AsEnumerable().Where(Function(row) String.IsNullOrWhiteSpace(row(“First Column”).ToString())).ToList().ForEach(Sub(row) row(“First Column”) = row(“Second Column”))

@rlgandu
Hi
Can plz explain it. ?

Hi @krishnapriya_Anu

You can simply try this

I/P:
image

O/P:
image

I hope you understand!!

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