I was developing an application in windows form but when wanting to update the datagridview and save it in the database this error occurs:
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.
all within the method private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
SqlCommand sqlcmm = new SqlCommand($"SELECT * FROM Cuenta_{todayDate}", connection);
SqlDataAdapter sqlAdapt = new SqlDataAdapter(sqlcmm);
SqlCommandBuilder sqlcmmBuilder = new SqlCommandBuilder(sqlAdapt);
sqlAdapt.Update((DataTable)dataGridView1.DataSource);
Just when I'm editing manually this error appears when editing a cell without a specific pattern after a moment of editing. Any ideas?