在 LinqPad 中,有没有办法将类型 XML 列序列化为字符串?

In LinqPad, is there a way to serialize type XML column as string?

我在 SQL 上有一个 XML 专栏。并且其中存在格式错误的数据。当我 运行 MyTable.Take(4).Dump();

时导致错误 "There are multiple root elements."

例如

<cy>
  <n>NameA</n>
  <p>true</p>
</cy>
<cy>
  <n>NameB</n>
  <p>false</p>
</cy>

有没有办法告诉 LinQPad 不序列化 XML 列并将其作为字符串提供?

Unfortunately data is tied up with many places so I can not wrap it with root element on database right away.

最新的 LINQPad beta 版本 5.10.06 允许您以字符串形式访问 XML 列:

NEW/IMPROVED:

There's a new checkbox in the SQL advanced connection properties dialog to map XML columns to .NET strings instead of XElements. This allows you to query tables with malformed XML without error.