I'm making a new application in ASP. I want an output with all joined data. I work in 3 layers.
So here is the join code
Public Function selectAllOpenBugs() As List(Of tbl_bug)
Dim result = (From b In dc.tbl_bugs
Join p In dc.tbl_priorities On b.BugPriority Equals p.priorityId
Join u In dc.tbl_users On b.BugOwner Equals u.userId
Join u1 In dc.tbl_users On b.BugAssigned Equals u1.userId
Where b.BugStatus = 1
Select b).ToList
Return result
End Function
Here is the code to get the results
Public Function selectOpen() As List(Of tbl_bug)
Return DALBugs.selectAllOpenBugs()
End Function
And here is the code to fill the repeater
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
rptOpenBugs.DataSource = BBLBugs.selectOpen()
rptOpenBugs.DataBind()
End Sub
And this is what the repeater shows
BugId BugTitle BugPriority BugStatus BugOwner BugAssigned BugProject BugPriority
1 TEST 1 1 1 2 1 tbl_priority
Why doesn't the repeater show the joined values?
Thanks in advance!
SOLUTION
You guys obviosly didn't understand my question. I work with entities i forgot to mension that in the question.
The problem wasn't to select the right values. I just needed to get the values in the repeater. Like this
<asp:Content ID="Content1" runat="server" contentplaceholderid="MainContent">
<table>
<asp:Repeater ID="rptOpenBugs" runat="server">
<ItemTemplate>
<tr>
<td><asp:Label ID="lblID" runat="server" Text='<%# Eval("BugId")%>'></asp:Label></td>
<td><asp:Label ID="lblTitel" runat="server" Text='<%# Eval("BugTitle")%>'></asp:Label></td>
<td><asp:Label ID="lblPrioriteit" runat="server" Text='<%# Eval("tbl_priority.priorityName")%>'></asp:Label> </td>
[....]
</td>
<td></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>