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

  • SEARCH
  • Home
  • 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 6106109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:02:40+00:00 2026-05-23T14:02:40+00:00

I use Asp.net and EF 4. In my model I have two Entities: CmsGroupsTypes

  • 0

I use Asp.net and EF 4.

In my model I have two Entities: CmsGroupsTypes wich has a navigational property called CmsContents to Entity CmsContents.

I’m using an EntityDataSource control together with a GridView.

I need return CmsGroupsTypes but filtering theme using the Navigational Property and QueryStringParameter.

With the following code I receive an error:

'ContentId' is not a member of 'Transient.collection[CmsModel.CmsContent(Nullable=True,DefaultValue=)]'. To extract a property of a collection element, use a subquery to iterate over the collection

<asp:EntityDataSource ID="EntityDataSource1" runat="server"
    ConnectionString="name=CmsConnectionStringEntityDataModel" DefaultContainerName="CmsConnectionStringEntityDataModel"
    EnableFlattening="False" EntitySetName="CmsGroupsTypes" Include="it.CmsContents.ContentId"
    Where="it.CmsContents.ContentId == ContentId">
    <WhereParameters>
        <asp:QueryStringParameter Name="ContentId" QueryStringField="ContentId" DbType="Int32" />
    </WhereParameters>
</asp:EntityDataSource>

Any idea what I’m doing wrong?

I have an equivalent version in LINQ and it is working but I have to implementing directily on the EntityDataSource Control.

      // Get ContentId from Query String.
        int myContentId = Convert.ToInt32(ContentIdFromUrl);
        // Find all GroupsType for a specific Content.
        var myGroupsTypesList = from g in context.CmsGroupsTypes
                                where g.CmsContents.Any(x => x.ContentId == myContentId)
                                select g;
  • 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-23T14:02:41+00:00Added an answer on May 23, 2026 at 2:02 pm

    Quick guess: Include takes the name of a navigation property, so instead of:

    Include="it.CmsContents.ContentId"
    

    shouldn’t it be

    Include="it.CmsContents"
    

    ?

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

Sidebar

Related Questions

I use ASP.NET and have a Button and a CustomValidator, which has to validate
I am creating a model binder to use with asp.net mvc. This is what
I use ASP.NET and have a label control on my page, which I fill
I'm writing a log parser for an asp.net mvc2 web application. I use Entity
I have two questions: I am developing a web system in asp.net mvc with
I have an ADO .Net Entity Data Model for my database. In this Model
In my Asp.net MVC app, I have two methods on a controller, one for
ASP.NET MVC 2.0: Simple Model Binding not working/binding as it should i have a
I want to have two radio buttons in my Asp.Net MVC3 App.There is no
I have an ASPNET MVC 2 project. When I use <%= Html.TextBoxFor(model => model.Login)

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.