i have a data table and i want to write this data table in text box. each column will separated by “[space]” and each column will separated with new line.
this is the expectation result:
James 2 ok
Brandon 2 Not_ok
Cherry 1 ok
please share the syntax for this case. Thank You
Yoichi
(Yoichi)
October 12, 2024, 8:12am
2
Hi,
How about the following expression?
String.Join(vbCrLf,dt.AsEnumerable.Select(Function(r) String.Join(" ",r.ItemArray)))
note: dt is DataTable
Regards,
randa_prakasa:
ames 2 ok
Bran
The result is like this:
Adi 20 active OK
Bambang 12 passive Y
Cherry 11 active Y
Danny 14 passive Y
have extra blank line in between. i want with no extra blank line
Yoichi
(Yoichi)
October 12, 2024, 8:30am
4
Hi,
Can you try to use vbLf instead of vbCrLf as the following?
String.Join(vbLf,dt.AsEnumerable.Select(Function(r) String.Join(" ",r.ItemArray)))
Regards,
its worked now. Thank you so much
1 Like
system
(system)
Closed
October 15, 2024, 8:41am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.