DigitSum[n_?IntegerQ,b_: 10]:=Total[IntegerDigits[n,b]]

?DigitSum

Max[Map[(Total[IntegerDigits[#,10]])&, Apply[Power, Tuples[Range[1,100],2], {1}]]]

IntegerDigits[123,10]

Tuples[Range[1,10],2]