private void bttn_login_Click(object sender, EventArgs e) { DataTable user = _common.GetPassword(txt_UserId.Text); try { if (user.Rows.Count == 0) { lbl_message.Text = "MSG: Invalid User ID"; lbl_message.Visible = true; clear(); } else if (user.Rows[0]["Password"].ToString() == txt_Password.Text) { result = true; this.Close(); } else { lbl_message.Text = "Incorrect Password"; lbl_message.Visible = true; clear(); } if (user.Rows.Count > 0) { type = user.Rows[0]["Type"].ToString(); } } catch (Exception ex) { string X = ex.Message; } }