I think your statement below may be causing a problem, it is assigning a 'Stringbuilder' object to a 'String' ... you also have other errors around the 'str2' statements further down in your code ...