Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 筛选LINQ to SQL中的文本列_C#_Linq - Fatal编程技术网

C# 筛选LINQ to SQL中的文本列

C# 筛选LINQ to SQL中的文本列,c#,linq,C#,Linq,我有一个疑问: string recordLevelKey = row.RecordLevelKey; var newValueShort = (from afl in this.Context.AuditLog_FieldLevel where (afl.Auditlog_RecordLevel_K == recordLevelKey &&

我有一个疑问:

string recordLevelKey = row.RecordLevelKey;
var newValueShort = (from afl in this.Context.AuditLog_FieldLevel
                     where
                         (afl.Auditlog_RecordLevel_K == recordLevelKey
                            && afl.FieldName.Trim().ToUpper() == "MYFUEKDNAME"
                            && afl.OldValue != afl.NewValue
                         )
                     select afl.NewValue).FirstOrDefault();
但它无法与文本进行比较

OldValue
NewValue
列的类型为(文本,null)。


那么我该如何解决这个问题呢

而什么类型是审核日志(Auditlog)(u RecordLevel)(L))?它抛出的异常消息的确切文本是什么?这些字段的C#类型是什么<代码>文本是SQL类型。文本列不能这样比较。如果可能,将基础表中的数据类型更改为varchar(max)。此外,在未来版本中,将根据从SQL Server中删除文本数据类型