Where [CastleType] is set as data type \"text\" in SQL Server and the query is:
SELECT * FROM [Village] WHERE [CastleType] = \'foo\'
I
If you can't change the datatype on the table itself to use varchar(max), then change your query to this:
SELECT * FROM [Village] WHERE CONVERT(VARCHAR(MAX), [CastleType]) = 'foo'