Extract Values from DT and store into String

Values stored in DT (Only one column):

BuyerEmailAddress

Jayaraj.K@test.com

Erika.Majszin@test.com

RPABOT04@test.com

Requirement :

Above Email Address captured from website and stored into Data Table.

We would like to store above email address in string variable (Always ignore RPABOT04@test.com email address ) separated by comma (,).

Expected output: Jayaraj.K@test.com , Erika.Majszin@test.com

Hi @Sathish_Kumar_S

Check below post for your reference

Hope this may help you

Thanks,
Srini

Hi @Sathish_Kumar_S

Try as below

String.Join(",",dt1.AsEnumerable().Where(Function (r) Not r.Field(Of String)("BuyerEmailAddress").equals("RPABOT04@test.com")).Select(Function(a) a.Field(Of String)("BuyerEmailAddress")).ToArray())

If this resolves your issue then please Mark as solution, so that others can be benifited

Thanks,
Srini

1 Like

@Sathish_Kumar_S

hi

string.join(“,”,dt.AsEnumerable.Select(Function(x) x(“BuyerEmailAddress”).ToString).Where(Function(x) x.ToString<>“RPABOT04@test.com”).ToArray)

cheers

1 Like

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