Copy data from one column to another column

  • Thread starter Thread starter philin
  • Start date Start date
P

philin

Hi,

I have a datatable in my application. Now I need copy data
from column 1 to column 2. Because the table has thousands
of rows, I can't do this by copying data one by one.
Thanks a lot for your help.

philin
 
Hi Philin,

Simply run a for each loop, reassign the value in col 1 to col2; update the
dataadapter at the end and you should be done. (If you want the back end
updated also, you'll need an update command or a commandbuilder.)

HTH,

Bernie Yaeger
 
Hi,
Thanks a lot for your help. The problem is if i have many
rows data, the loop will take long time.

philin
 
Hi Philin,

Not really. Even if you have a few 100,000 rows, it will be pretty quick.

Bernie
 
Back
Top