How can I display data from a LINQ table that's connected to a database?
<p>I'm trying tomake a booking system where I can  get data from a list in LINQ, and display it in a series of textboxes but I'm having problems as when I run the program it simply displays the number 1.</p>

<p>this is my code</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

namespace BookingCustomers
{
    public partial class BookingGuests : System.Web.UI.Page
    {
        private HotelConferenceEntities datacontext = new HotelConferenceEntities();

        private void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                    int id = int.Parse(BookID.Text.ToString());
                    tblBooking booking = datacontext.tblBookings.SingleOrDefault(x =&gt; x.BookingID == id);

                    tblVenue venue = datacontext.tblVenues.SingleOrDefault(x =&gt; x.VenueID == booking.Venue);

                    List&lt;tblCustomer&gt; customers = new List&lt;tblCustomer&gt;();
                    List&lt;tblBookingGuest&gt; guests = booking.tblBookingGuests.ToList();

                    foreach (tblBookingGuest guest in guests)
                    {
                        tblCustomer newcust = datacontext.tblCustomers.SingleOrDefault(x=&gt;x.CustomerID == guest.CustomerID);
                        customers.Add(newcust);
                    }

                    int count = customers.Count;

                    //string table=string.Join(",",customers);

                    int [] displayer={customers.Count};
                    int max=(displayer.Max());
                    CustFirstName.Text =displayer.Where(p=&gt; p== max).Count().ToString();
</code></pre>
