Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange error 'No DataRows'
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Problèmes
Titre:
Strange error 'No DataRows'
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:
01581526
Vues:
54
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
?
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform