col1 col2 col3
----- ----- ----
1 4 7
2 5 8
3 6 9
Is there a way to build a datatable with the following way:
- add column 1 as "col1"
- add row for column 1 with value 1,2,3
- repeat for next column and its respective rows
I was trying to begin with following codes but got stuck at second column and its rows
dt.Columns.Add("col1")
dt.Rows.Add(1)
dt.Rows.Add(2)
dt.Rows.Add(3)