Sometimes you need to do something like :
SELECT * FROM table WHERE sFieldName = sValue
Here is how to translate the above to LINQ
SELECT * FROM table WHERE sFieldName = sValue
Here is how to translate the above to LINQ
Dim db As New northwindDataContext Dim sFieldName = "City" Dim sFieldValue = "Berlin"
Dim q = From t In db.Customers.AsEnumerable. Where(Function(f) f.GetType.GetProperty(sFieldName).GetValue(f,Nothing) = sFieldValue) Select t
No comments:
Post a Comment