private void Thongtincanhan_Load(object sender, EventArgs e) { try { cn.OpenConn(); string sql = "select * from CANBO where MACB = '" + UsertName + "'"; rdr = cn.executeSQL(sql); while (rdr.Read()) { lbmacb.Text = rdr["MACB"].ToString(); lbmakhoa.Text = rdr["MAKHOA"].ToString(); lbhoten.Text = rdr["HOTEN"].ToString(); lbngsinh.Text = rdr["NGAYSINH"].ToString(); lbgioitinh.Text = rdr["GIOITINH"].ToString(); lbchucvu.Text = rdr["CHUCVU"].ToString(); lbemail.Text = rdr["EMAIL"].ToString(); //lbmk.Text = rdr["MATKHAU"].ToString(); lbqhan.Text = rdr["QUYENHAN"].ToString(); } } catch (Exception EX) { MessageBox.Show("Lỗi " + EX); } finally { cn.CloseConn(); } }
public string quyenhan(string USER) { cn.OpenConn(); string a = "select QUYENHAN from CANBO where MACB='" + USER + "'"; SqlDataReader dr = cn.executeSQL(a); string quyen = ""; while (dr.Read()) { quyen = dr[0].ToString(); } cn.CloseConn(); return(quyen); }