Querying database columns that are only known at runtime
Does each column that you want to retrieve from the database have to be known at compile time? Suppose that you let your customer create custom columns in the database for some tables. Is it possible to load them into your entity class (in a dictionary for example)? The full list of available columns would only be known at run time, not at compile time.
I don't see a solution for this scenario at the moment. I know it would be more difficult to work with these values, but now you can't do it at all. You could use ADO.NET for these values, but it would be ineffecient because you need an extra query.
Are there any plans to make this possible?
[659 byte] By [
Orantho] at [2008-2-7]
Thanks for your feedback. Currently, we do not have a way to access columns known only at run-time. We are starting with a simpler set of scenarios but open to feedback about incorporating the most common ones. Feedback from active and early users like you will of course help shape our thinking about which scenarios to add. In particular, dictionary is a very valuable collection in many situations.
Thanks.
Dinesh Kulkarni
Program Manager - The LINQ Project
http://blogs.msdn.com/Dinesh.Kulkarni/