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
Jyoti Jodha
NA
1.7k
407.2k
Update Password in Windows Form C#
May 11 2017 1:12 AM
Update Password in Windows Form C#
private void btn_Submit_Click(object sender, EventArgs e)
{
if (txt_UserName.Text == "" || txt_Password.Text == "")
{
MessageBox.Show("Please provide UserName and Password");
return;
}
try
{
SqlCommand cmd = new SqlCommand("UPDATE tbl_Login SET Password=@password where UserName=@UserName ", cs);
cmd.Parameters.AddWithValue("@UserName", txt_UserName.Text);
cmd.Parameters.AddWithValue("@password", txt_Password.Text);
cs.Open();
SqlDataAdapter adapt = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adapt.Fill(ds);
cs.Close();
int count = ds.Tables[0].Rows.Count;
if (count == 1)
{
MessageBox.Show("Password Changed Successfully!");
}
else
{
MessageBox.Show("Password Changed Failed!");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Reply
Answers (
4
)
I am using VSTO word add ins
Appendix in word