Blog Planet Wiki Why is this page pink?
Feed Feed It

Why am I still at work?

Thursday, May 27, 2004 08:54 PM

///

/// This is called when/// /// /// /// public int ChangePassword( string sqlServerLogin,string oldPassword,string newPassword ){int storedProcReturnValue = 1;DbHandle handle = new DbHandle();SqlParameter[] sqlParams = new SqlParameter[3];sqlParams[0] = new SqlParameter("@old",SqlDbType.VarChar,128);sqlParams[0].Value = oldPassword;sqlParams[1] = new SqlParameter("@new",SqlDbType.VarChar,128);sqlParams[1].Value = newPassword;sqlParams[2]= new SqlParameter("@loginame",SqlDbType.VarChar,128);sqlParams[2].Value = sqlServerLogin;string storedProcedure = "sp_password";try{storedProcReturnValue= handle.ExecuteScalar( System.Data.CommandType.StoredProcedure,storedProcedure,sqlParams);}catch(Exception ex){ErrorLog.LogEntry( "Cannot Perform Password change to SQL Server.",EventLogEntryType.Error,ErrorLogEventId.Database_Data_Update_Error,ErrorLogCategories.DATABASE,ex.StackTrace.ToString() );}return storedProcReturnValue;}