How can i take value from query result to label?
I have two label, one is labelName and one more is labelDepartment
So when i r
Check this one - Also set your connection string along with this code
SQLCommand command = new SQLCommand();
command.CommandText = " SELECT tbl_staff.staffName,tbl_department.department
FROM tbl_staff,tbl_logs,tbl_department
WHERE tbl_staff.userID = tbl_logs." + listStaff.SelectedValue + " and tbl_staff.idDepartment = tbl_department.idDepartment ";
SQLDataReader reader = command.executeReader();
while(reader.read())
{
labelName.Text = reader.GetString(0);
labelDepartment.Text = reader.GetString(1);
}