Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3791630
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:29:56+00:00 2026-05-19T12:29:56+00:00

I have 2 tables: User(Id PK, TitleId FK, Name, Active) Title(Id PK, Text) Table

  • 0

I have 2 tables:

User(Id PK, TitleId FK, Name, Active)

Title(Id PK, Text)

Table Title is a lookup table of titles (Mr, Miss,…) and its got a relationship with table User by TitleId.

Now I’m trying to display the data in a web page using .net and Entity Framework. I’m using a ListView control and a query as a source. it all displays fine except for the Title.

Here is my code:

    MyEntities _entities = new MyEntities ();

    User user = new User(_entities);
    IQueryable u = (from x in _entities.Users
           where x.Active == true
           select x);

    ListView1.DataSource = u;
    ListView1.DataBind();

and the code in the front end:

<asp:ListView ID="ListView1" runat="server" 
    EnableModelValidation="True" DataKeyNames="Id">

<ItemTemplate>
    <tr>
        <td>
            <%# Eval("Id") %>
        </td>
        <td>
            <%# Eval("Title.Text") %>
        </td>

        <td>
            <%# Eval("Name") %>
        </td>
     </tr>
</ItemTemplate>
<LayoutTemplate>
                 <table ID="itemPlaceholderContainer" runat="server">
                    <tr runat="server">
                        <th id="Th2" runat="server">
                            Id</th>
                        <th id="Th1" runat="server">
                            Title</th>
                        <th id="Th3" runat="server">
                            Name</th>
                        <th runat="server">
                    </tr>
                    <tr runat="server" ID="itemPlaceholder">
                    </tr>
                </table>

</LayoutTemplate>

How do I manage to get the Title Text associated with a User to display on the ListView?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T12:29:57+00:00Added an answer on May 19, 2026 at 12:29 pm

    I just figured out how to do it:

    _entities.Users.Include(“Title”)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three tables: user(id, name); tasks(id, user_id, text, date); bonus(id, user_id, sum, date,
I have 2 tables: User (Id, Title_Value FK ) Title (Value PK , Text)
I have three tables: User, Employee and Worker. User table has one-to-zero-or-one relationship with
I have these tables: USER TABLE uid | name | role | | 1
I have three tables, a user-table and two user-type tables. The user-type tables have
I created 3 tables: User User-Group Group Where I can have a many-to-many relationship.
I have 2 tables: User and Picture. The Picture table has the key of
I have (again) this tables: User: id | name ------------- 1 | 'John' 2
I have have 2 tables User and Group . I have a table Attributes
I have three tables [USER] --Master user table [KEYWORD] --Master keyword table [USER_KEYWORD] --[USER]-[KEYWORD]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.