Exemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            PinfoDataContext con = new PinfoDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\gadgets planet\Desktop\SalimProject\ClubManagementSystem\ClubDatabase.mdf;Integrated Security=True;Connect Timeout=30");
            var str = from a in con.ProfileInfos
                      select a;
            ProfileInfo s = str.Where(obj => obj.Id == Int32.Parse(textBox1.Text)).First();

            dataGridView1.DataSource = str.Where(obj => obj.Id == Int32.Parse(textBox1.Text));
        }
 public Database()
 {
     con = new PinfoDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\User\Desktop\Project\ClubManagementSystem\ClubDatabase.mdf;Integrated Security=True;Connect Timeout=30");
 }