예제 #1
0
파일: Form1.cs 프로젝트: vinayasshetty/ad2
        private void btnInsert_Click(object sender, EventArgs e)
        {
            var          dbCtx  = new ValtechDBDataContext();//creating object for connection
            tbl_employee record = new tbl_employee
            {
                Ecode  = int.Parse(txtEcode.Text),
                Ename  = txtEname.Text,
                salary = int.Parse(txtSalary.Text),
                deptid = int.Parse(txtDeptid.Text)
            };

            //insert using linq to sql
            dbCtx.tbl_employees.InsertOnSubmit(record);
            //save changes to database
            dbCtx.SubmitChanges();
            MessageBox.Show("Record inserted");
            //refresh datagrid
            RefreshData();
        }
예제 #2
0
 partial void Deletetbl_employee(tbl_employee instance);
예제 #3
0
 partial void Updatetbl_employee(tbl_employee instance);
예제 #4
0
 partial void Inserttbl_employee(tbl_employee instance);