private void btnInsert_Click(object sender, EventArgs e)
{
try
DataRow drCurrent = GetRow();
dataGridView1.Visible = false;
this.Validate();
clientTimesBindingSource.EndEdit();
int tbid = (int)drCurrent["TableID"];
DateTime time1 = (DateTime)drCurrent["Time In"];
DateTime time2 = (DateTime)drCurrent["Time Out"];
this.clientTimesTableAdapter.Insert((int)cbFullNames.SelectedValue, time1, time2);
MessageBox.Show("Update successful");
}
catch (System.Exception ex)
MessageBox.Show("Update failed:\n" + ex.ToString());
finally
dataGridView1.Visible = true;
dataGridView1.Refresh();