Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LINQ to datatable - how to create a variable?
Message
 
 
To
02/07/2013 09:02:40
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01576896
Message ID:
01577644
Views:
53
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform