Description: I want to show Table1 through PK2.
DB ERD:
(Table1,PK1)----(Relation_Table2_has_Table1, contained the Primary Key of Table1,Table2)----(Table2,PK2)
ASP.Net Code:
<asp:linqdatasource id="LinqDataSource1" runat="server" contexttypename="LinQDataContext" enableupdate="True" entitytypename="" tablename="Table1" where="Relation_Table2_has_Table1.Any(PK2==@data)">
<whereparameters>
<asp:sessionparameter name="data" sessionfield="data" type="String" />
</whereparameters>
</asp:linqdatasource>
If @data is Int, then PK2==Int32?(@data)
Refer: http://forumarray.com/c-binding-linqdatasource-to-two-separate-table-516379
沒有留言:
張貼留言