Beispiel #1
0
 //xóa bệnh
 private void bbttxoa_Click(object sender, EventArgs e)
 {
     try
     {
         UDQLDataContext ql = new UDQLDataContext();
         int             i  = ql.cau28(btxtmabenh.Text);
         if (i == 1)
         {
             MessageBox.Show("mã bệnh không  tồn tại");
         }
         else
         {
             tvbdgv.DataSource = from a in ql.Benhs where 1 == 1 select new { a.MaBenh, a.TenBenh };
         }
     }
     catch (Exception)
     {
         MessageBox.Show("không thể xóa vì bị tham chiếu");
     }
 }