- 保存时出错!
private void employeeInfoBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
try
{
BankDataContext c = new BankDataContext();
LoginInfo t = new LoginInfo();
t.编号 = 编号TextBox.Text;
t.密码 = "123";
t.权限 = 0;
c.LoginInfo.InsertOnSubmit(t);
c.SubmitChanges();
this.employeeInfoBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.myDataSet);
bindingNavigatorAddNewItem.Enabled = true;
MessageBox.Show("保存成功!");
}
catch(Exception ex)
{
MessageBox.Show(ex.Message,"保存失败!");
}
}