0

I have two tables, orderlist and products. I want to retrieve RecipeLink value from products table. So how can i join the orderlist & product table in one go ? I tried with && but no luck. I'm still new to c# aspnet , anyone can provide an example for me ? Thanks in advance?

enter image description here

enter image description here

  public partial class CancelOrder : System.Web.UI.Page
    {
        BraceletDataContext bc = new BraceletDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["Id"];
            lblOrderID.Text = id;
            Delivery de = bc.Deliveries.SingleOrDefault(x => x.OrderID == id);
           
            var s = from x in bc.Order_Lists && bc.Products 
                    where x.OrderID == id 
                    select new

                    {
                        x.OrderID,
                        x.ProductID,
                        x.Product.ProductName,
                        x.ClassStatus,
               
                        x.Timetable,
                        x.Link,
                        x.Trainer,
                        x.Start,
                        x.End,
                        x.RecipeLink
                    };

            
            Repeater1.DataSource = s;
            Repeater1.DataBind();
        }
WEI ZHUANG GOH
  • 313
  • 1
  • 13
  • 1
    You need to use `join`. Please check https://stackoverflow.com/questions/2767709/join-where-with-linq-and-lambda – Meer Nov 17 '21 at 11:09
  • Does this answer your question? [What is the syntax for an inner join in LINQ to SQL?](https://stackoverflow.com/questions/37324/what-is-the-syntax-for-an-inner-join-in-linq-to-sql) – Deniz Nov 18 '21 at 13:22

0 Answers0