1)
Why did he say "you are a Chacham? you know what you will do to him"?
1.
Rashi: You are a Chacham to find something for which he will be Chayav Misah! (Refer to 2:9:2:1.)
2.
Malbim: Test him if he will properly guard the king's word. If he will not, kill him!
2)
David swore not to kill him (verse 8). May he command Shlomo to kill him?
1.
Radak (8): He was Chayav Misah, but I swore to him. To fulfill the Shevu'ah, do not kill him until you find another sin.
2.
Malbim: This is why he said "v'Atah." Do not kill him for what he did, since I swore to him, but if he sins from now and onwards, do not pardon him.