public DataTable getExist(BEL.BEL_taiKhoan account) { DataTable data = new DataTable();; string query = @"SELECT ma_nhan_vien from taikhoan where tai_khoan=@taikhoan and mat_khau = @matkhau and da_xoa ='0'"; try { using (SqlConnection connect = new SqlConnection(connectionString.connectionstring)) { connect.Open(); SqlDataReader reader = null; SqlCommand cmd = new SqlCommand(query, connect); SqlParameter para_tk = new SqlParameter(); para_tk.ParameterName = "@taikhoan"; para_tk.Value = account.taikhoan; SqlParameter para_mk = new SqlParameter(); para_mk.ParameterName = "@matkhau"; para_mk.Value = account.matkhau; cmd.Parameters.Add(para_tk); cmd.Parameters.Add(para_mk); reader = cmd.ExecuteReader(); //reader.Read(); data.Load(reader); //reader.Close(); connect.Close(); } } catch (Exception err) { throw; } return(data); }
public static DataTable getExist(BEL.BEL_taiKhoan account) { DAL_taiKhoan obj = new DAL_taiKhoan(); return(obj.getExist(account)); }