Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LINQ to datatable - how to create a variable?
Message
 
 
À
02/07/2013 09:02:40
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01576896
Message ID:
01577644
Vues:
51
>I don't think you can. I rarely use anon types because of the restrictions on their usage. I generally just create a class definition like the anyonymous fields I want and then fill that class instead of an anon type. That way I can pass it around as a parameter if need be.
>
>Did a quick google on anonymous types in c# and found this: "The type name cannot be specified in the variable declaration because only the compiler has access to the underlying name of the anonymous type.".

Thanks again. I think I am doing slightly better coding now and I've re-factored a few of the finished methods as well.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform