Reputation: 622
Hello i am having this problem: i am downloading data from xml using linq library those data i want to add them on a textblock item
TextBlock1.Text = TextBlock1.Text & result
but it has an error :
Error 1 Operator '&' is not defined for types 'String' and 'System.Xml.Linq.XElement'.
When i am changing this line to :
TextBlock1.Text = TextBlock1.Text & result.Tostring
it works but it adds this data :
"<"data> data <"/data>
instead of :
hello
any ideas ??
Upvotes: 0
Views: 312
Reputation: 141668
You probably want result.Value
:
TextBlock1.Text = TextBlock1.Text & result.Value
You can look at the MSDN Documentation for more information about XElement.Value
.
On another note, you can use:
TextBlock1.Text &= result.Value
As a shorter way of writing it.
Upvotes: 1