filmov
tv
VB.NET - Get all row data from data table

Показать описание
Here is the code you can use to retrieve all row data from a data table.
VB.NET - Get all row data from data table
Dim rowData As String = ""
'dt is the name of the data table
For Each row As DataRow In dt.Rows
For Each column As DataColumn In dt.Columns
rowData = rowData & column.ColumnName & "=" & row(column) & " "
Next
rowData = rowData & vbNewLine & vbNewLine
Next
MessageBox.Show(rowData)
VB.NET - Get all row data from data table
Dim rowData As String = ""
'dt is the name of the data table
For Each row As DataRow In dt.Rows
For Each column As DataColumn In dt.Columns
rowData = rowData & column.ColumnName & "=" & row(column) & " "
Next
rowData = rowData & vbNewLine & vbNewLine
Next
MessageBox.Show(rowData)