我想在LINQ to得到的maxDate where子句。如果我尝试下面,它会引发错误。获取最大日在LINQ查询
var dt1 = dtCurTopSQL.AsEnumerable()
.Where (l =>
l.Field<DateTime>("SAMPLE_TIME").Max() >= DateTime.Now.AddSeconds(lastxminutes))
错误:
Error CS1929 'DateTime' does not contain a definition for 'Max'
要读出错误消息。 – SLaks
@SLaks它只是不适用于此语法。 –
_为什么不呢?什么happens_ – SLaks