private void btnAdd_Click(object sender, EventArgs e) { DataLinqDataContext db = new DataLinqDataContext(); DemoLinQ demoLinQ = new DemoLinQ(); demoLinQ.id = Int32.Parse(txtId.Text); demoLinQ.name = txtName.Text; demoLinQ.sdt = txtPhone.Text; db.DemoLinQs.InsertOnSubmit(demoLinQ); db.SubmitChanges(); dataGridView1.DataSource = db.DemoLinQs.Select(p => p).ToList(); }
partial void UpdateDemoLinQ(DemoLinQ instance);
partial void DeleteDemoLinQ(DemoLinQ instance);
partial void InsertDemoLinQ(DemoLinQ instance);