Beispiel #1
0
 private void btLogIn_Click(object sender, EventArgs e)
 {
     linqxmlDataContext asd = new linqxmlDataContext();
     //bool contains = tbl.AsEnumerable()
     //   .Any(row => searchAuthor == row.Field<String>("Author"));
     var pass = (from c in asd.User
                 where c.Name == tbName.Text
                 select c.Password
                 ).firstordefault
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            linqxmlDataContext context = new linqxmlDataContext();
            var customers = from c in context.customers
                            where c.ExpDate != null
                            select new
            {
                Név     = c.Name,
                Lejárat = c.ExpDate
            };

            foreach (var customer in customers)
            {
                listBox1.Text += customer.Név + "\r\n";
                listBox1.Items.Add(customer.Név);
            }
            dataGridView1.DataSource = customers;
        }