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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:44:45+00:00 2026-05-25T06:44:45+00:00

I am working on an application for Windows Phone platform. Run into a question.

  • 0

I am working on an application for Windows Phone platform. Run into a question.

I’d 2 different List, 1 is direct read from xml file, and the other by some calculation. And I want to merge this two lists into 1, so I can display it out.

List 1:

public class studentClass1
{
    public string studentID { get; set; }
    public string studentFirstName { get; set; }
    public string studentLastName { get; set; }
}

List 2:

public class studentClass2
{
    public string studentID { get; set; }
    public string studentGradePoint { get; set; }
}

First of all, I had readout the studentClass1 via

var studentList= from query in studentIndex.Descendants("student")
                             select new driversClass
StudentList1 = studentList.ToList();

Secondly, I process the student Grade Point calculation on the function and output to the 2nd list :

studentClass2 SG = new studentClass2
            {
                studentID = thestudentID ,
                studentGradePoint  = thestudentGradePoint .ToString()
            };

            StudentList2.Add(SG);

studentListAll = StudentList1 + StudentList2

now, I want to join this two list together so that I can output to screen by calling

studentResultListBox.Itemsource = StudentListAll;

any suggestion the code how would look like?
Thanks.

  • 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-25T06:44:46+00:00Added an answer on May 25, 2026 at 6:44 am

    Assuming you just want to combine the appropriate info from both lists (it is not totally clear from your question) – introduce a third class studentClass3 that holds all the properties you want and use a join to match instances with a matching studentID:

    var studentList3 = (from s1 in studentList1
                        join s2 in studentList2 on s1.studentID equals s2.studentID
                        select new studentClass3()
                        {
                            studentFirstName = s1.studentFirstName,
                            studentID = s1.studentID,
                            studentGradePoint = s2.studentGradePoint,
                            studentLastName = s1.studentLastName
                        }).ToList();
    

    In general this problem should be rather solved when you read in the XML than trying to combine the lists later on – having three different classes for students might be confusing. Also take a look at the recommended naming conventions, they are a little off.

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

Sidebar

Related Questions

I am developing Windows Phone 7 application which read some text and speak the
I'm working with an application that logs to Windows Application Log regularly (viewable through
I'm working on a windows forms application (C#) where a user is entering data
I am working on a windows form application. How do i use the find
I'm working on an application that runs on Windows Mobile 6 that needs to
I am working on a Windows Forms application in VS 2008, and I want
I'm working on an application that displays some child windows which can either be
I'm working on a Windows Forms (.NET 3.5) application that has a built-in exception
I am working on a simple chat application using a System.Windows.Forms.WebBrowser Control to display
I'm working on a PyGTK/glade application that currently has 16 windows/dialogs and is about

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.