Why was God not angry with Solomon's Census In 2 Chronicles 2:17 we are told "Solomon took a census of all the foreigners residing in Israel, after the census his father David had taken; and they were found to be 153,600." Why was God not angry about this Census, yet furious with David for taking a Census?
Maybe it was because Solomon took a census of all the foreigners, while David numbered the children of Israel without making this offering:

And the LORD spake unto Moses, saying, When thou takest the sum of the children of Israel after their number, then shall they give every man a ransom for his soul unto the LORD, when thou numberest them; that there be no plague among them, when thou numberest them. This they shall give, every one that passeth among them that are numbered, half a shekel after the shekel of the sanctuary: (a shekel is twenty gerahs:) an half shekel shall be the offering of the LORD. Every one that passeth among them that are numbered, from twenty years old and above, shall give an offering unto the LORD. The rich shall not give more, and the poor shall not give less than half a shekel, when they give an offering unto the LORD, to make an atonement for your souls. [Exodus 30:11-15 KJV]

God wanted the children of Israel numbered only so that they would know how much to give to the Lord. David just wanted to know, with Satan's influence, how big his army was; he was putting his trust in his military might rather than in the promises of God.