TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vandana Sardana
NA
54
0
Password match problem
Oct 29 2009 2:41 AM
I am developing a windows application, my database is in MS-Access, i have the user details form which will store all the users detail as well as create the username and the password for login to the application. It is working all right but i have used 2 textboxes, 1 for password and the other one for confirmpassword. I want that the password and the confirmpassword should be same. But it is not happening. Now the user can feed 2 passwords. But actually this should not happen. Please help me out how to do it. The coding for the user details form is: private void btnadd_Click(object sender, EventArgs e) { pageAction = "ADD"; ClearFields(); SetEditState(true); txtusrname.Focus(); } private void btnsave_Click(object sender, EventArgs e) { try { ConnectionClass l_ConnectionClass = new ConnectionClass(); userId = l_ConnectionClass.generateIDnew("select max(userId) from [tbluserlogin]"); userName = txtusrname.Text.ToString(); userPwd = txtpwd.Text; userConPwd = txtconfirmpwd.Text; string logouttime = DateTime.MinValue.ToString(); users = l_ConnectionClass.checkuser(userName); if (users > 0) { MessageBox.Show("username already exists."); } else { l_ConnectionClass.SaveAddUser(userId, userName, userStatus, userRole, userPwd, userConPwd, logouttime); LoadGrid(); ClearFields(); txtusrname.Focus(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void btndelete_Click(object sender, EventArgs e) { try { ConnectionClass l_ConnectionClass = new ConnectionClass(); if (MessageBox.Show("You want to delete it.", "User Details", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK) { l_ConnectionClass.DeleteAddUser(userId); ClearFields(); LoadGrid(); } else { return; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void btncancel_Click(object sender, EventArgs e) { LoadGrid(); SetEditState(false); } private void btnclose_Click(object sender, EventArgs e) { this.Close(); } private void dgvuserlogin_SelectionChanged(object sender, EventArgs e) { try { if (dgvuserlogin.SelectedRows.Count > 0) { userId = Convert.ToInt32(dgvuserlogin.CurrentRow.Cells["userId"].Value); PublicVariables.OSUserID = Convert.ToInt32(dgvuserlogin.CurrentRow.Cells["userId"].Value); userName = Convert.ToString(dgvuserlogin.CurrentRow.Cells["userName"].Value); userStatus = Convert.ToInt32(dgvuserlogin.CurrentRow.Cells["userStatus"].Value); string _userRole = dgvuserlogin.CurrentRow.Cells["userRole"].Value.ToString(); if (_userRole == "Admin") { rbtnadmin.Checked = true; } else { rbtnadmin.Checked = false; } if (_userRole == "Normal") { rbtnnormal.Checked = true; } else { rbtnnormal.Checked = false; } if (_userRole == "Display") { rbtndisplay.Checked = true; } else { rbtndisplay.Checked = false; } userPwd = Convert.ToString(dgvuserlogin.CurrentRow.Cells["userPwd"].Value); userConPwd = Convert.ToString(dgvuserlogin.CurrentRow.Cells["userConPwd"].Value); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } Please help with the changes in the coding
Reply
Answers (
2
)
datagridview: accessing embedded controls row by row
password change rights