Hi,
I changed the password using Old password. I am not used the Set password this time. I used the change password. It worked. in C#.
PrincipalContext PrincipalContext = new PrincipalContext(ContextType.Domain, ConfigurationManager.AppSettings["ADSServerIP"].ToString(), usertype);
UserPrincipal User = UserPrincipal.FindByIdentity(PrincipalContext, userid);
User.ChangePassword(strOldPassword, newpassword);