private void StaffProfile_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'dbEMSDataSet.Request' table. You can move, or remove it, as needed. lblLoggedInAs.Text = LoginForm.SetValueForText1; lblEmployeeID.Text = LoginForm.EmpID; int EmpID = Convert.ToInt32(LoginForm.EmpID); DataTable dt = new DataTable(); string time = DateTime.Now.ToString("h:mm:ss tt"); string date = DateTime.Now.ToString("dd/MM/yyyy"); lblDate.Text = date; lblTime.Text = time; dt = sb.ViewProfile(EmpID); lblRequestID.Text = mrb.RequestID(); foreach (DataRow dr in dt.Rows) { txtFirstName.Text = dr[1].ToString(); txtSurname.Text = dr[2].ToString(); txtContact.Text = dr[3].ToString(); txtEmail.Text = dr[4].ToString(); txtHouseNo.Text = dr[5].ToString(); txtStreetName.Text = dr[6].ToString(); txtCity.Text = dr[7].ToString(); txtPostCode.Text = dr[8].ToString(); txtDesignation.Text = dr[9].ToString(); txtDepartment.Text = dr[10].ToString(); txtJobTitle.Text = dr[11].ToString(); if (Convert.ToInt32(dr[12].ToString()) == 1) { lblGender.Text = "Male"; } else { lblGender.Text = "Female"; } if (Convert.ToInt32(dr[13].ToString()) == 1) { lblStatus.Text = "Active"; } else { lblStatus.Text = "Inactive"; } } DataSet ds = sb.GetReqComboBoxItems(EmpID); cmbReqID.ValueMember = "Req_ID"; cmbReqID.DisplayMember = "Req_ID"; cmbReqID.DataSource = ds.Tables[0]; }