I have a table in an SQL database, where the table configuration corresponds to
ID
Name string
data xml
where the datafield might (but not necessarily) contain a descendant element
<config>Some value...</config>
Using LINQ I want to select all the rows that has a data xml element which contains the config element with a value of... say 17.
My approach has been something like:
var query = from x in db
from y in x.data.descendants("config")
where y.Value == "17"
select x;
But this throws an exception about the Value not being valid.
How should I formulate this query?
Regards, Casper