Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange error 'No DataRows'
Message
De
27/08/2013 15:46:55
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Problèmes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01581526
Message ID:
01581540
Vues:
66
This message has been marked as the solution to the initial question of the thread.
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform