How to concatenate two columns in datatable without looping and keep concatinated data in new column?


#1

This is the my case:

dt1
Name Account
AA 123
BB 345
CC 654

Output should like this:
Name Account Formula
AA 123 AA123
BB 345 BB345
CC 654 CC654

This should done without loops

Thanks


#2

Hi, From where this datatable is populated, there itself you can try to populate the third column as well. Sorry if my understanding is not correct here. Let us know where you are getting the datatable dt1.


#3

DB or from Excel


#4

If it is from DB then we can achieve this using query in the database itself.
If it is from Excel, then append the excel before reading it for the third column then read it.


#5

Don’t go for excel or DB , I want this manipulation on DataTable only.


#6

Hi,

Check this link, they tried the similar stuff only.


#7

The expected result is single column table with same three rows but two column merged into single column like (A1-b1, a2-b2, a3-b3)