如果你使用LINQ to SQL过程中遇到异常:SQL Server does not handle comparison of NText, Text, Xml, or Image data types,可能你的数据库表字段中使用了NText,Text,Xml或者Image类型,你需要为dbml自动生成类的相应属性的Attribute添加上UpdateCheck=Never。

需要注意xml在dbml对于的类型为XElement,XElement是引用类型,如果需要对该字段进行更新,不能直接修改,需要重新创建一个XElement,否则所做的修改无法更新到数据库。

 

参考链接:Linq to SQL throws an exception when a column is of type ntext

相关文章:

  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-07-13
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2021-07-22
  • 2021-07-05
相关资源
相似解决方案