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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:41:42+00:00 2026-05-26T18:41:42+00:00

In my last question , i successfully to dump the data into combo box

  • 0

In my last question, i successfully to dump the data into combo box with solution from Leo but now, i want to get everything of specific user and store into generic list. i tried with this code but it’s not working. May i know is there something wrong with my code ?

  var contexti = new OrganizationContext();
  //contexti.Load(contexti.GetAdminPassQuery(userName), LoadInfo, null);
  EntityQuery query = contexti.GetAdminPassQuery(userName);
  contexti.Load<tblAdmin>(query).Completed += (sender, args) =>
           {
                  List<AdminInfo> list = ((LoadOperation<tblAdmin>) sender).Entities.
                                         ToList();}

this is in the domain context.

    public IQueryable<tblAdmin>  GetAdminPass(string adminId)
    {
        return this.ObjectContext.tblAdmins.Where(e => e.adminID.Equals(adminId));
    }

this is the generic list store in helper folder

    public class AdminInfo
{
    public string AdminId { get; set; }
    public string AFirstName { get; set; }
    public string ALastName { get; set; }
    public string AEmail { get; set; }
    public string APassword { get; set; }
}

Thank you for reply

  • 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-26T18:41:42+00:00Added an answer on May 26, 2026 at 6:41 pm

    AdminInfo is not the same type as tblAdmin so you need to manually create a new list:

    contexti.Load<tblAdmin>(query).Completed += (sender, args) =>
    {
        List<AdminInfo> list = new List<AdminInfo>();
    
        //for each entity returned, create a new AdminInfo and add it to the list
        foreach (var item in ((LoadOperation<Car>)sd).Entities)
        {
            list.Add(new AdminInfo(){ AdminId = item.AdminId, AFirtsName = item.FirstName /*other properties*/});
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Learning from my last question , most member names seem to get included in
The last question I asked concerned how to bin data by x co-ordinate. The
Following on from my last question What is a Stub , I would really
Following from my last question which @Jon Skeet gave me a lot of help
You may notice from my last question that a problem caused some more problems,
This is a followup to my last question . I now have a byte[]
has_many build method, Rails Was my last question. It now works: no errors. The
My last question was somewhat narrower than this one. I am interested to know
My last question was about getting the string representation of an object serialized to
Let me rephrase my last question, what PHP library or framework can I use

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.