>Hi everybody,
>
>I'm getting the error listed below on this piece of code:
>
>var queryResult = from podsPref in dtPodsPrefs.AsEnumerable()
> where (podsPref.Field<Int32>("pref_id") == prefRow.Field<Int32>("pref_id")
> && podsPref.Field<String>("pod_id") == row.Field<String>("pod_id"))
> select podsPref;
>
> if (0 == queryResult.Count())
> {
> if (prefRow.Field<Boolean>("is_reqd") && requestMatch == 0)
> skipIt = true;
> }
> else
> {
> foreach (var qRow in queryResult)
> {
> String podyesValue = qRow.Field<String>("datavalue");
> if (String.IsNullOrWhiteSpace(podyesValue))
> good = false;
>
>
>
> error "System.InvalidOperationException: The source contains no DataRows.\r\n at System.Data.DataTableExtensions.LoadTableFromEnumerable[T](IEnumerable`1 source, DataTable table, Nullable`1 options, FillErrorEventHandler errorHandler)\r\n at System.Data.DataTableExtensions.CopyToDataTable[T](IEnumerable`1 source)\r\n at Siriusware.Middleware.Bookings.GetPods(Dictionary`2 preferences, DateTime dateTime, ReturnType returnType, Boolean resourceOnly, String bookingIds)
>
>In the debugger I see that Count() does not return 0. So why do I get no 'DataRows' error
>?
Your stack trace shows a call to CopyToDataTable, but nothing in the code you posted appears to be calling that.