You haven't actually told us what the problem is, which is in the following
dg2.DataSource = row1
If you go to the documentation on
DataGridView.DataSource[
^] you will see
Quote:
The DataGridView class supports the standard Windows Forms data-binding model. This means the data source can be of any type that implements one of the following interfaces:
- The IList interface, including one-dimensional arrays.
- The IListSource interface, such as the DataTable and DataSet classes.
- The IBindingList interface, such as the BindingList<t> class.
- The IBindingListView interface, such as the BindingSource class.
If you go to the documentation for the
DataRow Class[
^] you will note that it does not implement
any of those interfaces which means it cannot be used as a DataSource for your DataGridView. You probably want a
DataTable [
^] for that.
Something like this might work (untested!)
Dim tempData As New DataTable
tempData.Rows.Add(row1)
dg2.DataSource = tempData
This doesn't get away from the fact that this is
bad UI design - see the comments from @Richard-MacCutchan and @Gerry-Schmitz.
It is not difficult to design a pleasing and easy-to-use form consisting of the appropriate controls and to assign the individual values in the datarow columns to those controls. Your approach smacks of laziness