Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting same data table after LINQ query
Message
 
 
À
10/06/2014 17:51:54
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01601612
Message ID:
01601722
Vues:
29
Hi Rob,

This doesn't seem to work as is
  if (resourceEvent)                              
                  {
                      // Remove instructors who don't have anything planned
                      var query = dtInstructors.AsEnumerable().Where(c => dtAllScheduled.AsEnumerable().Any(b =>  1 == b.Field<Byte>("layer") 
                                          && true==b.Field<Boolean>("schdassign") && c.Field<String>("instr_id")== b.Field<String>("resource_id")
                                          ));
                      query.CopyToDataTable(dtInstructors, LoadOption.OverwriteChanges);
                  }
My dtInstructors has rows but dtAllScheduled does not.

After the query I am supposed to get 0 rows in the dtInstructors but it seems to be the same table as it was before the query. Do you see how can I adjust the code to get the query "overwrite" my original table?

Thanks.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform