Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            CompanyDBDataContext dc = new CompanyDBDataContext();
            Emp obj = new Emp();

            obj.Empno = int.Parse(EnoBox.Text);
            obj.Ename = EnameBox.Text;
            obj.Job   = JobBox.Text;
            obj.Sal   = decimal.Parse(Salary.Text);
            obj.Ename = EnameBox.Text;
            dc.Emps.InsertAllOnSubmit(obj);
        }
Exemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            CompanyDBDataContext db = new CompanyDBDataContext();

            dataGridView1.DataSource = db.Emps;
        }
Exemplo n.º 3
0
 private void Form2_Load(object sender, EventArgs e)
 {
     dc        = new CompanyDBDataContext();
     Employees = dc.Emps.ToList();
     ShowData();
 }