Read data from table without For Each Row

Hello all,

How can I read data from Data Table without for each row. Not single row.

Thank you a lot

Maybe this could help?

You could use DataTable.Rows or DataTable.Columns and their respective index.

Sorry, I want read all data from column, example
Name LastName Phone
Joe Crue 00022200
Gru Dumond 45632114
John Wick 12345678

if I write this syntax

strName = dt1.rows(0)(“Name”).toString I will get only Joe, but I need all names from columns “Name”, “LastName”, “Phone”

string.join(Enviroment.NewLine, yourDataTable.Rows.Cast(of DataRow).Select(function(row) string.join(",",row.Item(“Column1”).ToString))

The inner String.Join is unnecessary, you’re also missing some parens, and this assumes that the OP is requesting a String as output. However, they were unclear about exactly what they want.

If you want a String, then I would suggest:
String.Join(", ", Data.Rows.Cast(of DataRow).Select(Function(Row) Row(“Name”)))

If you want an Array of the names:
Data.Rows.Cast(of DataRow).Select(Function(Row) Row(“Name”).ToString).ToArray