Last post Aug 07, 2014 03:13 PM by akpaga22
Aug 06, 2014 04:21 PM|akpaga22|LINK
I am trying to use a query extender to filter my entity data source as shown below:
<asp:EntityDataSource ID="Equipment_DS" runat="server" ConnectionString="name=FieldEquipmentEntities" DefaultContainerName="FieldEquipmentEntities"
EnableFlattening="False" EntitySetName="lu_Equipment" >
<asp:QueryExtender TargetControlID="Equipment_DS" ID="EqQueryExtender" runat="server">
<asp:CustomExpression OnQuerying="FilterEq" />
protected void FilterEq(object sender, CustomExpressionEventArgs e)
using (var db = new FieldEquipmentEntities())
e.Query = from a in e.Query.Cast<lu_Equipment>()
join t in db.TransferDetails on a.Eq_number equals t.Eq_number
where t.Trans_StatusId ==5
But the above code for FilterEq method does not work ..Can someone please guide me if my LINQ statement is wrong.
Aug 07, 2014 03:13 PM|akpaga22|LINK
I solved my issues using commandText property of the enitydatasource where i could write down the sql query of joing my two tables.
i completely removed the query extender part.