Click here to Skip to main content
15,881,588 members
Articles / Desktop Programming / Win32

Address Book and Events Reminder

Rate me:
Please Sign up or sign in to vote.
4.74/5 (37 votes)
13 Feb 2009CPOL16 min read 105.1K   10.7K   106  
Allows to maintain and backup your contacts and also maintains a reminder. You can store data in any of the three different databases like Microsoft SQL Server, MySql, Microsoft Access
using System;
using System.Windows.Forms;

namespace AddressBook
{
    public partial class frmChangePassword : Form
    {
        public frmChangePassword()
        {            
            InitializeComponent();
        }
       
        private void UpdatePassword(object sender, EventArgs e)
        {
            if (txtNewPassword.Text.Length < 4) { MessageBox.Show("The Length of the password must be atleast in four chars.","Update Failed"); return; }

            if (txtNewPassword.Text != txtConfPassword.Text) { MessageBox.Show("New Password dose not match Confirm Password.", "Update Failed"); return; }

            if (UserPolicies.Password != txtOldPassword.Text)
            {
                MessageBox.Show("Old Password is not valid.","Update Failed");
                return;
            }

            UserPolicies.Password = txtNewPassword.Text;
            Program.Connection.CommandText = "update ContactsUserAccount set UserPassword=@UserPassword where UserID=" + UserPolicies.UserID;
            Program.Connection.AddParameter("@UserPassword", txtNewPassword.Text);
            if (Program.Connection.ExecuteNonQuery().ToString() == "1")
                MessageBox.Show("Password changed successfully.", "Process Completed");
            else MessageBox.Show("Due to some problems your password cannot be changed. Contact your administrator to change it or try again later.", "Update Failed");
            this.Close();
        }

        private void CancelUpdate(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India


Completed B.Com(CS) at DGVC and GNIIT Software Engineering at NIIT. Resident at Chennai and working as a Software Engineer.



 Language / Technology :

C#, ADO.NET, ASP.NET, MVC, WCF, ASP, PHP, XML, Java, J2EE, HTML, JavaScript, JQuery, AngularJS, VB Script, C++, MS SQL Server, SSRS, MySql, Oracle, Oracle Forms Development, Windows, Linux.



Click here to view other articles.


Mail Me at:  shridhar_tl@ymail.com


Visit my Site:  www.iCodeIt.in


Comments and Discussions