Exemple #1
0
        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();
        }
Exemple #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            // db = new DataClasses1DataContext();

            /* var var = (from DemoLinQ in db.DemoLinQs
             *          where DemoLinQ.id == 1
             *           select  DemoLinQ).FirstOrDefault();*/
            using (DataLinqDataContext db = new DataLinqDataContext())
            {
                dataGridView1.DataSource = db.DemoLinQs.Select(p => p).ToList();
            }
        }
 public void SQL()
 {
     using (DataLinqDataContext dataClasses1DataContext = new DataLinqDataContext())
     {
     }
 }