LINQ stands for "Language Integrated QUery"
This really great feature can drastically ease SQL request.
Here is an example :
Here is the corresponding SQL statement :
Choose your camp :-)
This really great feature can drastically ease SQL request.
Here is an example :
var products = from p in db.Products
where p.Category.Categoryname == "Beverages"
select p;
Here is the corresponding SQL statement :
SELECT [t0].[ProductID], [t0].[ProductName], [t0].[SupplierID], [t0].[CategoryID], [t0].[QuantityPerUnit], [t0].[UnitPrice], [t0].[UnitsInStock], [t0].[UnitsOnOrder], [t0].[ReorderLevel], [t0].[Discontinued]
FROM [dbo].[Products] AS [t0]
LEFT OUTER JOIN [dbo].[Categories] AS [t1] ON [t1].[CategoryID] = [t0].[CategoryID]
WHERE [t1].[CategoryName] = 'Beverages'
Choose your camp :-)




0 commentaires:
Enregistrer un commentaire