I have a windows forms application using ms access database but am having some issue with my login form. When i try to login the code can`t log me in after i input the right password and user name and am wondering what the problem might be
Here is my code
- DataSet ds = GetData.getInfo("select * from Users where UserName='" + txt1 + "' and Pswd1='" + txt2 + "'", "Users");
- if (info.Tables[0].Rows.Count > 0)
- {
- if (info.Tables[0].Rows[0][2].ToString() == txt2)
- {
- getSettings.SessionId = this.cmbSession.SelectedIndex;
- getSettings.Session = this.cmbSession.Text;
- if (!string.IsNullOrEmpty(info.Tables[0].Rows[0]["Role_Id"].ToString()))
- {
- getSettings.UserRoleId = Convert.ToInt32(info.Tables[0].Rows[0]["Role_Id"]);
- getSettings.UserRole = this.GetData.getInfo("SELECT Role FROM Role_Master WHERE Role_Id=" + (object)getSettings.UserRoleId);
- }
- this.DialogResult = DialogResult.OK;
- this.Close();
-
- }
Here is the Users Table