Dear Friends, please check my code, I want to update data with pressing A+ctrl ... but it does not work? code is below...
- protected override void OnKeyDown(KeyEventArgs e)
- {
- base.OnKeyDown(e);
- if(e.KeyCode==Keys.A && e.Control)
- {
- try
- {
- scb = new SqlCommandBuilder(da);
- da.Update(dt);
- MessageBox.Show("Recode updated", "Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
- Form2 f1 = new Form2();
- f1.Show();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- }