'Can i use LINQ in ADO .Net?

This is a insert to my simple employee database, which is in SSMS:

Insert into dbo.tbl_empdetail (empid,empname,salary) values(@emp,@emp_name,@emp_salary)

and this is a update:

string query = "Update dbo.tbl_empdetail set empname=@name,salary=@salary where empid=@id"

How can i do it with LINQ?

Like this:

from student in studentList
                where student.age>10          
                select student.Name;


Solution 1:[1]

The direct answer to your question would be to look at implementing IQueryable interface. check out https://github.com/mattwar/iqtoolkit

If all you wish is to use a typed query to work with a database, the best way would be to use an ORM like "Entity Framework" or "NHibernate". They generally have a LINQ provider that will allow you to query a database.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1