2
현재 두 개의 매개 변수로 SQL 쿼리를 필터링하고 날짜 필드로 정렬하려고합니다. 또한 각 항목에는 고유 한 ID가 있습니다. 나는 가장 최근의 행을 얻으려고하고 있는데, 그 행이 원하지 않는 조건과 일치하면 테이블의 다음 항목을 다시 쿼리합니다. 그러나 이전에 발견 된 결과를 해당 ID에서 유일하다고 알려진 경우에만 제외해야합니다. 도 soultion 근무하지만쿼리의 목록에있는 데이터를 어떻게 필터링합니까?
List<string> prevChecked = new List<string>;
do{
var query = (from someRow in context.aTable
where someRow.Param1.Equals(param1Arg) &&
someRow.Param2.Equals(param2Arg)
// Trying to Exclude any Unique in results that have a
// matching uniqueID inside of prevChecked
orderby someRow.RecentDate descending
select someRow).FirstOrDefault();
// Use result of query, to get result of anotherQuery,
// if null append the query.UniqueID to prevChecked
}while (anotherQuery != null)
내가
!someRow.UniqueID.Contains(prevChecked)
를 사용하여 시도하고 "제외"기능 중 하나 개가 웹 페이지에 언급보고했습니다
이것은 thusfar 내가 한 것입니다.
아를, 대단히 감사합니다. 나는 노력했다 ! someRow.UniqueID.Contains (prevChecked); 그것은 지금 오류를 설명합니다. – JSA
@FenrirProtocol, 오신 것을 환영합니다. – Habib