Hi, I want to read and write all email Id with “;” separated in one Cell in excel sheet, where I have email id’s row by row in excel. kindly help me , pls see the screen shot for reference
expected Output :
Hi, I want to read and write all email Id with “;” separated in one Cell in excel sheet, where I have email id’s row by row in excel. kindly help me , pls see the screen shot for reference
expected Output :
Use below Linq Query
Emails = String.Join(";", DT.AsEnumerable().Select(Function(row) row("Email").ToString()))
Regards,
dtInput
.strOutput = String.Join(";"c,dtInput.AsEnumerable().Select(function(x) x.Field(Of String)(“Email”)).ToArray())
Thanks,
Ashok
Hi Ashok ,
function(x) - > what is this X here?
and X. field
It’s just syntax we use in LINQ. you can any other name if you want for understanding. This x
will hold a data row value while iterating through the data with LINQ.
x.Field
will get the Email
column value to compare.
Thanks Working fine this solution
Thanks You , working fine
Glad I was helpful. Kindly close the thread by marking my answer as solution.
Thanks,
Ashok
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.