hi
i have DataGridView (that hold any DataBase)
i want to insert any value into any Cell (and that this value will save on DataBase)
how to do it (in C#)
thank's in advance
hi
i have DataGridView (that hold any DataBase)
i want to insert any value into any Cell (and that this value will save on DataBase)
how to do it (in C#)
thank's in advance
You can access any DGV cell as follows :
dataGridView1.Rows[rowIndex].Cells[columnIndex].Value = value;
But usually it's better to use databinding : you bind the DGV to a data source (DataTable
, collection...) through the DataSource
property, and only work on the data source itself. The DataGridView
will automatically reflect the changes, and changes made on the DataGridView
will be reflected on the data source