protected void btnDelete_Click(object sender, EventArgs e)
        {
            EmployeTbl empTbl = db.EmployeTbls.Single(em => em.empId == Convert.ToInt32(txtId.Text));

            db.EmployeTbls.DeleteOnSubmit(empTbl);
            db.SubmitChanges();
            ShowGrid();
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            EmployeTbl empTbl = db.EmployeTbls.Single(em => em.empId == Convert.ToInt32(txtId.Text));

            empTbl.empName = txtName.Text;
            empTbl.empSal  = Convert.ToSingle(TxtSalary.Text);
            db.SubmitChanges();
            ShowGrid();
        }
        protected void btnInsert_Click(object sender, EventArgs e)
        {
            EmployeTbl emp = new EmployeTbl();

            emp.empName = txtName.Text;
            emp.empSal  = Convert.ToSingle(TxtSalary.Text);
            db.GetTable <EmployeTbl>().InsertOnSubmit(emp);
            db.SubmitChanges();
            ShowGrid();
        }
コード例 #4
0
 partial void DeleteEmployeTbl(EmployeTbl instance);
コード例 #5
0
 partial void UpdateEmployeTbl(EmployeTbl instance);
コード例 #6
0
 partial void InsertEmployeTbl(EmployeTbl instance);