Data Table convert to single string and Split the Data

Hello,
I have a dataTable I have to Split the Row values and get them in following Format.

DT Values :
Car
Mobile
House

Expected Format : Single String
item 1 is - Car ; item 2 is - Mobile ; item 3 is : House

and need to write in Excel, e.g “A1”

Any help idea would be appreciated.

Thanks

@Palaniyappan
I read many of your Post and they were very helpful for me, while I was learning.

Can you please help me with this, your guidance would be appreciated.

Thanks.

Hey @Gagan_Chaudhari

Yep, that’s possible. I just mimicked the entire string you showed not sure whether you need that item :sweat_smile:

String.Join(";",dtData.AsEnumerable.Select(Function(row, index) "item " + CStr(index+1) + " is - " + row(0).ToString))

Also do you want to write it in only in one Excel cell all the values of the DT right ?

Kindly try this.

Thanks
#nK

Hey ,
I alter some part of it and It’s working,

Thanks a lot :slight_smile:

Cool buddy great :slightly_smiling_face::+1:

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