tags:

views:

273

answers:

0

Basically a reference problem. I have a query that joins two tables together. There is at least one field named the same between the two (for the join).

I return an IList and assign it to the datasource of control with bound fields. But It can't find the fields in the rows.

           Dim myQuery As IQuery = session.CreateQuery("from DB_Associate a, DB_Association ass  where a.User_ID = ass.User_ID and ass.Account_ID = :acctNum")
            myQuery.SetParameter("acctNum", acctNum)
            resultList = myQuery.List()

With the result bound to the DetailsView

        usersDV.DataSource = userList  <--from resultsList above
        usersDV.DataBind()

The data control (DetailsView)

       <asp:DetailsView ID="usersDV" runat="server" Height="50px" Width="390px">
            <Fields>
                <asp:BoundField DataField="a.User_ID" HeaderText="User_ID" />
                <asp:BoundField DataField="User_Name" HeaderText="User Name" />
                <asp:BoundField DataField="EMail" HeaderText="EMail" />
                <asp:ButtonField CommandName="showUserPermissions" Text="User Permissions" />
            </Fields>
        </asp:DetailsView>

The Tables Objects fields: Associate: (class DB_Associate, table Associate)

    User_ID As Integer
    User_Name As String
    Email As String
        ...

Association: (class DB_Association, table Association)

    ID As Integer
    User_ID As Integer
    Account_ID As Integer

I have tried a few combinations and have not found documenation that would help yet.

I get:

A field or property with the name 'a.User_ID' was not found on the selected data source.

Which suggests that I need to find the right reference for the field.

--John Putnam