This question is locked. New answers and comments are not allowed.
Hi,
I am trying to use linq to make a left outer join. I have two tables one is called FF_Item and the other is called FF_QuotationDetails. I want that the data from table FF_Items appears either there is a matching record exist in FF_QuotationDetails or not. But right now I am not getting any data in my gridview.
Protected Sub rgGroupItem_DetailTableDataBind(ByVal source As Object, ByVal e As GridDetailTableDataBindEventArgs) Handles rgGroupItem.DetailTableDataBind
Dim dataItem As GridDataItem = e.DetailTableView.ParentItem
Dim ItemID As String = dataItem.GetDataKeyValue("ID").ToString()
Dim items = From item In dbContext.FF_Items.DefaultIfEmpty
Join quotation In dbContext.FF_QuotationDetails
On item.ID Equals quotation.ItemID
Where (item.GroupID = ItemID)
Select item.ID, item.ItemName, item.Price, item.Rate, quotation.Quantity, quotation.TotalCost
e.DetailTableView.DataSource = items.ToList
End Sub
I am trying to use linq to make a left outer join. I have two tables one is called FF_Item and the other is called FF_QuotationDetails. I want that the data from table FF_Items appears either there is a matching record exist in FF_QuotationDetails or not. But right now I am not getting any data in my gridview.
Protected Sub rgGroupItem_DetailTableDataBind(ByVal source As Object, ByVal e As GridDetailTableDataBindEventArgs) Handles rgGroupItem.DetailTableDataBind
Dim dataItem As GridDataItem = e.DetailTableView.ParentItem
Dim ItemID As String = dataItem.GetDataKeyValue("ID").ToString()
Dim items = From item In dbContext.FF_Items.DefaultIfEmpty
Join quotation In dbContext.FF_QuotationDetails
On item.ID Equals quotation.ItemID
Where (item.GroupID = ItemID)
Select item.ID, item.ItemName, item.Price, item.Rate, quotation.Quantity, quotation.TotalCost
e.DetailTableView.DataSource = items.ToList
End Sub