views:

77

answers:

1

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

+1  A: 

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

Thomas Levesque