Skip to content
Loading
  • Prem Anandh J
    0
    1. customer.ProductName= r.Items[i].ProductName;   
    Add Product name in for loop
    0
  • 0
    Hi,
    Thnaks for your reply
    while debugging it was showing undefiend
    in Items table i have Name,Id,OrderId and ProductID
    Probelm is that it has been displaying only productid
    i need productName 
    0
  • Prem Anandh J
    0
    You have to change the SQL query .
    Write Join query with Items and Product table. So that u can get Product name also
    Still having doubt , share the select query of Items 
    0
  • 0
    Could please check this is my query for Items 
    List listItem = new List();
    var items = (from i in db.Items5
    where i.OrderId == orderID
    select new
    {
    Id = i.Id,
    Name=i.Name,
    ProductID =i.ProductID,
    }).ToList();
    foreach (var item in items)
    {
    listItem.Add(new Items5 { Id = item.Id,Name=item.Name, ProductID=item.ProductID});
    }
    0