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?
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();
}