How to Copy data from one column to other column in same data table,second column is empty

how to Copy data from one column to other column in same data table,second column is empty

@ndivya

Let us take you are having a datatabe dta

You want to copy data from column 1 to column 2

then use below Query

dta= (From p In dta.Select
            Select dta.Rows.Add(p("Column1Name").ToString,p("Column1Name").ToString)).ToArray.CopyToDataTable

Regards,
Mahesh

1 Like

Its replacing the first column value.
I want first column and second column also to be dispalyed.Second column value should be copied ti third column and display whole datatable

So out put should be like:
DTA

What is problem with simplest solution? ForEach Loop by all rows in dt and assign inside loop r(“Column2”) = r(“Column1”)

1 Like