2016-08-01 19 views

Antwort

0

Ihre Frage ist sehr, sehr generisch. In jedem Fall ist hier eine Probe.

'Create a new datatable 
     Dim table2 As New DataTable 
     table2.Columns.Add("Name") 

'loop through your existing datatable - add the records to the columns you want 
    For Each dr As DataRow In Table1.Rows 
      Dim R As DataRow = dt.NewRow 
      R("Name") = dr("TABLE1_COLUMNNAME") 
      dt.Rows.Add(R) 
    Next 
'turn the new datatable into the datagridview. 
DataGridView1.DataSource = table2