Code Snippet posted by: Akiii
| Posted on: 2/14/2012 | Category: LINQ Codes
| Views: 773 | Status: [Member]
| Points: 40
| Alert Moderator
var query = from h in dbk.Employee_table
where h.City == "London"
dbk = It is the DataContext object (With the help of this object, we can get access to any table in the respective database)
The above query will be translated to sql :-
SELECT Emp_ID, City, ...
WHERE City = [London]
The above query will get all the rows in the employee table with city column containing "London" as it value.
Thanks and Regards