Getting records with LINQ
Hello
I'm trying to get the records of a SQL view with LINQ. Then I want to iterate through all records (for each....next) and perform an action. I want to query the view depending on a condition (for example all records or only those with name "Brown").
Name of view: view_users
Name of entity: myentities
I'm struggling defining the correct type (DIM users as ????) and how I have to get the list of users with all columns.
If x=1 then
users=from r in myentities.view_users where name=Brown
else
users=from r in myentities.view_users
end if
for each users in ????
next
I know that this is not the correct syntax. I'm sure that it's quite simple, I just don't know how to do it.
Any help?
Thanks
Alexander Avidan
|