Subsonic – Filter by XML Column DataType

subsonicsubsonic3

I have downloaded Subsonic 3.0.0.3 and I have a XML DataType in my MSSQL database. The property comes back as a string which is fine however how do I create a line of code to filter by contents in that column.

If I try something like from x in Table.All() where x.XMLColumn.Contains("test") it throws an exception because although the property is a string and the above will compile when it turns it into SQL its incorrect for that column type.

Best Answer

Interesting - I haven't run into querying XML inside of a DB call but I can see how it would be useful. To get you around your issue I would suggest using a SPROC for now or using the Simple Query tool which does a better job of being explicit. http://subsonicproject.com/docs/Simple_Query_Tool

You can also use CodingHorror which allows you to write your own SQL (parameterized) http://subsonicproject.com/docs/CodingHorror

Related Topic