-
DataTables and DataGrid
Can someone give me a little bit of advice on DataTables.
I need to understand how I can manipulate data from within a datagrid bound to a dataset.
To do this do I have to create a datatable or is one created automatically. I am a bit lost on the use of the datagrid and need to get my head around it.
In particular I need to be able to loop through a gris to make appropriate changes.comparisons and am a bit lost.
Thanks in advance
-
Create a dataset first. Fill it with data from the dataadapter and it fills to a datatable within the dataset.
DataAdapter.Fill(Dataset, "MyTable")
Bound the datagrid to the dataview of the datatable in the dataset
DataGrid.DataSource = DataSet.Tables("MyTable").DefaultView
Every row in the datatable is an objRow
For each DataRow in DataTable.Rows
DataRow("ColumnOne") = "Softwaremaker.NET Rocks !!!"
Next