Querying a view

Querying a view is the same as querying a table. For example, you can query the view "current product lists" like this:

var currentProducts = from p in db.Current_Product_Lists
select p;
foreach (var p in currentProducts)
{
Console.WriteLine("Product ID: {0} Product Name: {1}", p.ProductID, p.ProductName);
}

This will get all of the current products, using the view.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset