J
jpuopolo
Hi all,
This is a cross-cutting question...
In our app, we use LINQ-to-SQL to read some data from SQL Server. One
of the columns we read from SQL Server is an XML column. When we
execute the LINQ query, we get a well-formed object. This well-formed
object contains several fields, one of which is an XElement. This
XElement corresponds to the SQL Server's XML column - so far, so good.
The problem we have is trying to then bind the returned object to a
WPF-based form using data binding. If we try the following:
<TextBox Text={Binding Path=SimpleXml ........}
We get a string representation of the XML block; however, if we try
this:
<TextBox Text={Binding XPath=SimpleXml/employee......} we get the
following error:
System.Windows.Data Error: 43 : BindingExpression with XPath cannot
bind to non-XML object.
We've tried a bunch of different XPath-style expressions in order to
pull out what we need - and we keep getting this error. Nothing seems
to work.
Thoughts?
Thanks,
jpuopolo
This is a cross-cutting question...
In our app, we use LINQ-to-SQL to read some data from SQL Server. One
of the columns we read from SQL Server is an XML column. When we
execute the LINQ query, we get a well-formed object. This well-formed
object contains several fields, one of which is an XElement. This
XElement corresponds to the SQL Server's XML column - so far, so good.
The problem we have is trying to then bind the returned object to a
WPF-based form using data binding. If we try the following:
<TextBox Text={Binding Path=SimpleXml ........}
We get a string representation of the XML block; however, if we try
this:
<TextBox Text={Binding XPath=SimpleXml/employee......} we get the
following error:
System.Windows.Data Error: 43 : BindingExpression with XPath cannot
bind to non-XML object.
We've tried a bunch of different XPath-style expressions in order to
pull out what we need - and we keep getting this error. Nothing seems
to work.
Thoughts?
Thanks,
jpuopolo