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 7553141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:58:04+00:00 2026-05-30T10:58:04+00:00

I have a problem similar to this topic http://forums.asp.net/t/1763534.aspx/1 I have to show data

  • 0

I have a problem similar to this topic http://forums.asp.net/t/1763534.aspx/1

I have to show data to customers based on their username. I do not create a new topic because I’ve done that long ago and nobody has responded. I ask you because you seem to know it more than others …

This is my controller

public ActionResult Index()
{
    MembershipUser currentUser = 
        Membership.GetUser(User.Identity.Name, true /* userIsOnline */);


    ViewBag.UsersRecord = currentUser.ProviderUserKey;

    var details = from t in db.Employes
                  where t.UserId ==ViewBag.UsersRecord
                  select t;

    return View(details.ToList());

}

Strangely, Visual Studio shows me an error here

where t.UserId == ViewBag.UsersRecord

“An expression tree may not Contain dinamyc in operation”

I’ve done something wrong?

  • 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-30T10:58:05+00:00Added an answer on May 30, 2026 at 10:58 am

    You can’t use dynamic, since dynamic is determined at compile time.
    try:

    Guid userId = (Guid)ViewBag.UsersRecord;
    
    var details = from t in db.Employes
                      where t.UserId == userId.ToString() //if you are using a string guid, otherwise remove ToString()
                      select t;
    
    //or simply
    
    var details = from t in db.Employes
                      where t.UserId == (Guid)currentUser.ProviderUserKey
                      select t;
    

    I don’t know what your UserId is (type wise) so can’t give you a 100% answer here

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

Sidebar

Related Questions

I notice this thread: Fastish Python/Jython IPC , and I have a similar problem,
I have checked this similar question, but the suggestions did not solve my problem:
I have a cross-tab report which similar to this Problem is when there are
Similar to this question: link However I have already mastered that. My problem is
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have found couple of similar topic about this but none of them solve
I know there have been similar questions on this topic but I wasn't completely
I have a problem similar to this one: How can I execute code after
Still quite new to Python. I have a problem similar to this question .
I have a problem very similar to this one : CATransaction Not Animating I'm

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.