Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Linq Blues
Message
De
14/01/2015 10:02:54
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Versions des environnements
Environment:
C# 4.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01613589
Message ID:
01613605
Vues:
40
What type is customers?

>Right. Many thanks. I applied .First() to r1, but that did not work.
>
>In fact it all boils down to :
>
>
>DataRow r1 =customers.AsEnumerable().First(r => (r.Field<string>("ID") == ID));
>
>
>>Instead of .Where, try .First or .FirstOrDefault. You'll need to test for condition where no records are returned.
>>
>>>Succeeded in getting this passed the editor. Note that customers is a DataTable.
>>>
>>>  IEnumerable<DataRow[]> r1 = (IEnumerable<DataRow[]>) customers.AsEnumerable().Where(r => (r["ID"] == ID));
>>>
>>>
>>>now how do I get the first row cast as a DataRow?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform