Been trying to solve this issue for the past couple of days and it is really frustrating me. I am only getting a single record displayed inside the `GridView`.

Below is the LINQ code I am using:

```
public IQueryable GetSubCatWithCatName()
    {
        return 
            (from sc in this.Entities.SubCategory
                join c in this.Entities.Category
                on sc.CategoryID equals c.ID

                select new
                {
                    sc.ID,
                    CategoryName = c.Name,

                    SubCategoryName = sc.Name,
                    SubCategoryImage = sc.ImageURL
                });
    }

```

I am displaying the results in a `GridView` component, however only the first record is getting displayed 

I have tried a few other versions of the above code to no avail. 

Would anyone please help ? 

Below is how my `GridView` is defined, if it could be of any help.

```
<asp:GridView ID="gvSubCategories" runat="server" DataKeyNames="ID" AutoGenerateColumns="false"
        onrowdatabound="gvSubCategories_RowDataBound" 
        onselectedindexchanged="gvSubCategories_SelectedIndexChanged">
        <Columns>
            <asp:CommandField ShowSelectButton="true" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Image ID="imgSubCategory" runat="server" Width="100px" Height="100px" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="CategoryName" HeaderText="Category Name" />
            <asp:BoundField DataField="SubCategoryName" HeaderText="Sub Category Name" />
            <asp:BoundField DataField="SubCategoryImage" HeaderText="Sub Category Image" />
        </Columns>
</asp:GridView>

```

In .cs Class

```
gvSubCategories.DataSource = new BASubCategory().GetSubCatWithCatName();
gvSubCategories.DataBind();

```

In BASubCategories

```
    public IQueryable GetSubCatWithCatName()
    {
        return new DASubCategory(this.Entities).GetSubCatWithCatName();
    }

```

In DASubCategories

```
public IQueryable GetSubCatWithCatName()
{
    return 
        (from sc in this.Entities.SubCategory
            join c in this.Entities.Category
            on sc.CategoryID equals c.ID

            select new
            {
                sc.ID,
                CategoryName = c.Name,

                SubCategoryName = sc.Name,
                SubCategoryImage = sc.ImageURL
            });
}

```

in RowDataBound

```
protected void gvSubCategories_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            SubCategory currentSubCat = (SubCategory)e.Row.DataItem;

            //Image img = (Image)e.Row.FindControl("imgSubCategory");
            //img.ImageUrl = currentSubCat.ImageURL;
        }
    }

```