After series of trials and error, i finally found what i was looking for, thus being able to update database from datagridview below is my worked around code which works 100% hope it helps someone in future, and thanks @RageComplex for helping out, but one more thing does anyone know how to implement that i mean instead of hitting the enter button to take changes in the datagridview you rather click on a button ty private void dataGridView1_RowValidated(object sender, DataGridViewCellEventArgs e) { try { DataTable changes = ((DataTable)dataGridView1.DataSource).GetChanges(); if (changes != null) { MySqlCommandBuilder mcb = new MySqlCommandBuilder(mySqlDataAdapter); mySqlDataAdapter.UpdateCommand = mcb.GetUpdateCommand(); mySqlDataAdapter.Update(changes); ((DataTable)dataGridView1.DataSource).AcceptChanges(); MessageBox.Show("Cell Updated"); return; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } 这篇关于Datagridview单元格值更改更新数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-21 15:04