开发者

LinqPad Data at the root level is invalid

开发者 https://www.devze.com 2023-04-06 02:59 出处:网络
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 some

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

LinqPad Data at the root level is invalid

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号