Do Proverbs and Ecclesiastes have polar opposite views of wisdom? I've noticed that Proverbs and Ecclesiastes have shockingly differing views of wisdom and knowledge:

“Her [wisdom and understanding personified] ways are pleasant ways and all her paths are peace.” (Proverbs 3:17)
“Because in much wisdom there is much grief, and increasing knowledge results in increasing pain.” (Ecclesiastes 1:18)

Clearly peace is not the same thing as grief, nor is pain the same as pleasant.  Considering that there is no argument over that, what then make sense of these two verses.  Can they both be true at the same time?  Is wisdom and understanding a grievously pleasant and peacefully painful thing?  Are we supposed to do the math and determine that wisdom is just average then in every regard?
How can these two verses be understood so that they are both true, but can be in harmony with each other and not be a ridiculously obvious contradiction?
I have of late taught that "wisdom" in the book of Proverbs is best understood as the understanding of God's ways or will and the application of such.  In other words, acting and behaving in the manner which God intends for us.  "Knowledge" can be understood in a similar fashion.  This interpretation of wisdom, in my opinion, can be applied to all instances of "wisdom" within Proverbs with the resulting understanding of the passage remaining consistent with all of scripture.  Again, this is my opinion.

However, if we look at Ecc 1:16-18, it would seem the author is boasting that he is responsible for his wisdom and intelligence, not God, and through that he could determine on his own what was foolishness in thought and deed apart from the discernment and direction of God.  But, he knows now such a thing is futile because the more he did what he thought in his own mind as wise, the more trouble he brought upon himself.  So, in this sense, despite both books using the same word the connotation of it is different in these three verses.

To answer the question, then, yes, the two instances of wisdom are indeed polar opposites in that God's wisdom, the understanding and application of His will for our lives, is diametrically opposed to following our own "wisdom" which is selfish, self-interested (Pr 14:2 and others), and governed by a deceitful heart (Jer 17:9).