我想在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