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
Saman Udaya
NA
2
864
All ways show this error "Confirm Password Not Matching With
Jun 12 2018 12:32 AM
private void button1_Click(object sender, EventArgs e)
{
if (txtFirstName.Text == "" || txtUserName.Text == "" || txtPassword.Text == "" || txtConfirPassword.Text == "")
{
MessageBox.Show("Not Allowed Empty Field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (string.IsNullOrEmpty(txtPassword.Text) && string.IsNullOrEmpty(txtPassword.Text) && txtPassword.Text.Equals(txtConfirPassword.Text))
{
int i = 0;
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from tblAddUser where UserName='" + txtUserName.Text + "'";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
i = Convert.ToInt32(dt.Rows.Count.ToString());
if (i == 0)
{
SqlCommand cmd1 = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into tblAddUser values('" + txtFirstName.Text + "','" + txtLastName.Text + "','" + txtUserName.Text + "','" + txtPassword.Text + "','" + txtConfirPassword.Text + "')";
cmd.ExecuteNonQuery();
MessageBox.Show("Sucess");
return;
}
else
{
MessageBox.Show("User Name Is Already Exits");
return;
}
}
else
{
MessageBox.Show("Confirm Password Not Matching With Password");
// return;
}
Reply
Answers (
4
)
Updating label with data from thread
How to get sql server password in C# windows