Where [CastleType] is set as data type \"text\" in SQL Server and the query is:
SELECT * FROM [Village] WHERE [CastleType] = \'foo\'
I
Please try this
SELECT * FROM [Village] WHERE CONVERT(VARCHAR, CastleType) = 'foo'