null in datagrid

G

Guest

i getting only "null" in my dataGrid
can someone tell me why??
thanks


Dim DataGrid1 As New DataGrid

Dim Table1 As DataTable
Table1 = New DataTable("AllExercises")

With Table1
.Columns.Add(New DataColumn("first", GetType(System.String)))
.Columns.Add(New DataColumn("second", GetType(System.String)))
.Columns.Add(New DataColumn("res", GetType(System.String)))
End With

Dim dr As DataRow
Dim dc As DataColumn

For Each dr In dsAdd.Tables(0).Rows
Dim dr1 As DataRow = Table1.NewRow
For Each dc In dsAdd.Tables(0).Columns

dr1.Item("first") = dr(dc.ColumnName).ToString
dr1.Item("second") = dr(dc.ColumnName).ToString
dr1.Item("res") = dr(dc.ColumnName).ToString
Next
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

HelpMeDataView 1
DataViewHelp 5
HelpMe 2
inserting new row in datatable 3
Help 2
Align one Datagrid column 2
Maintain a DataTable between postbacks... 4
RowState remains Unchanged after edit DataGridView 3

Top