view

CREATE VIEW [dbo].[ViewProductsTBL]      AS

       SELECT productTBL.name productName,

                     categoryTBL.name categoryName,

                     productTBL.description,

                     productTBL.price

       FROM productTBL INNER JOIN categoryTBL

              ON productTBL.catID = categoryTBL.Id

 

private void productWin_Load(object sender, EventArgs e)

{

     var tmp = (from s in db.ViewProductsTBL orderby s.price descending select s).ToList();

     dataGridView1.DataSource = tmp;

}