I want to create a LINQ to entities query getting data(join) out of two tables and bind the result as datasource to a datagridview.
Unfortunately I seem to stumble upon a syntax issue.
Table 1 : dcpricing.tblpricing Table 2 : dcpropertydetail.tblpropertydetail
Grid: grdpricing
Dim qry = (From propertyobj In dcPropertyDetail.tblproperydetail
Join Pricingobj In dcPricing.tblpricing
On propertyobj.prop_det_index Equals Pricingobj.prop_id
Where (propertyobj.prop_det_Status = 1)
Select propertyobj.prop_det_Name, Pricingobj.prop_rental_double).ToList
grdpricing.datasource = qry
The error pops when passing the query and shows: [COLOR="Red"]The specified LINQ expression contains references to queries that are associated with different contexts.[/COLOR]
I appreciate all help! Stijn