我正在使用SQLite本地數據庫在Windows Phone 7應用程序上工作,我堅持了一下。CoolStorage字段不等於過濾器
我有幾個類的定義,他們每個人都有一個映射設置,我希望檢索一些過濾列表。我發現了很多例子,如何檢查相等的值,但沒有檢查不相等的檢查。
CSParameterCollection parameters = new CSParameterCollection();
parameters.Add("@CurrentDate", currentDate);
parameters.Add("@DirectionId", intVisszaut);
CSList<Trip> RouteTrips = Route.Trips.FilteredBy("Services.StartDate <= @CurrentDate and Services.EndDate >= @CurrentDate and Services." + DayOfWeek.ToString() + " = 1 and DirectionId = @DirectionId", parameters);
這個濾鏡沒有任何問題,但是當我用下面的更新,它失敗!
(Services.CalendarDates.Date = @CurrentDate和Services.CalendarDates.Date.ExceptionType! = 2)
CSParameterCollection parameters = new CSParameterCollection();
parameters.Add("@CurrentDate", currentDate);
parameters.Add("@DirectionId", intVisszaut);
CSList<Trip> RouteTrips = Route.Trips.FilteredBy("(Services.CalendarDates.Date != @CurrentDate and Services.CalendarDates.Date.ExceptionType != 2) and Services.StartDate <= @CurrentDate and Services.EndDate >= @CurrentDate and Services." + DayOfWeek.ToString() + " = 1 and DirectionId = @DirectionId", parameters);
錯誤代碼是: '' 類型的第一次機會異常發生在Vici.CoolStorage.WP7.dll
服務是OneToOne,Services.CalendarDates是OneToMany映射。我是否使用了太多的過濾器值或者我做錯了什麼?它也不能使用<>。
似乎表達式過濾器是錯誤的。我已經將它們全部刪除並逐個構建起來,並且以這種方式工作。 :P – Bhawk1990 2012-03-06 17:00:28