Using Reflection to retrieve Entity Framework Data using a Column Name String

If you ever need to retrieve data from EF using the name of a column, rather than the built in Intellisense, then the following code snippet may help. GetType(TypeOfEntity).GetProperty(NameOfColumn).GetValue(ActualEntity, Nothing)TypeOfEntity is the name of the Entity from which you wish to retrieve data. NameOfColumn is obviously the Name of the Column from which you [...]

By |2017-07-24T08:33:19+01:00November 20th, 2012|.Net Framework, C#, Data, Entity Framework,, Visual Studio|0 Comments