public void GetMemberDetail(int MemberId) { dbProcedures db = new dbProcedures(); System.Data.SqlClient.SqlDataReader reader; reader = db.GetMemberDetail(MemberId); try { if (reader.Read()) { if ((!object.ReferenceEquals(reader[0], System.DBNull.Value))) { lblMemberId.Text = reader[0].ToString(); txtUsername.Text = reader[1].ToString(); txtPassword.Text = reader[2].ToString(); cbInvalidPassword.Checked = Convert.ToBoolean(reader[3].ToString()); cbInactive.Checked = Convert.ToBoolean(reader[4].ToString()); txtFirstName.Text = reader[5].ToString(); txtLastName.Text = reader[6].ToString(); txtCarrier.Items.Add(new ListItem("Blue Shield CA", "BlueShieldCA")); txtCarrier.Items.Add(new ListItem("Anthem", "Anthem")); txtCarrier.SelectedValue = reader[7].ToString(); txtEmployerGroup.Text = reader[8].ToString(); lblCreationTS.Text = reader[9].ToString(); lblUpdatedTS.Text = reader[10].ToString(); } else { lblMemberId.Text = "Error retrieving member detail."; btnDelete.Visible = false; btnUpdate.Visible = false; } } } catch (Exception e) { lblMemberId.Text = "Error retrieving member detail."; btnDelete.Visible = false; btnUpdate.Visible = false; } reader.Close(); db.Close(); }