Hi,
What exactly is the Error you're getting?
I'm not sure the values of your StringBuilder in property SB are properly returend. As GetDataRowOutput() doesn't return the value and the value of sb is only passed as a property.
You say:
display only 3 page type where field is true
There is no where clause or page type selection in your query so not sure if you want to filter?