LinqPad Data at the root level is invalid
I am trying to execute linq command Users.Take (50)
and g开发者_开发百科et error "Data at the root level is invalid. Line 1, position 1."
. Why?
I'm guessing one of the first 50 records contains something that isn't true XML.
Note, SQL will allow you to save simple text to these columns, so if you have values like <Name>Joe</Name>
this will display correctly in C#/VB, but values like Joe
won't.
get error
"Data at the root level is invalid. Line 1, position 1."
. Why?
b/c it's not valid XML
Workaround
On your connection, you can:
Map XML columns to .NET strings instead of XElements
精彩评论