0

I have two tables: Student (StuID, Name, Sex, MajorID, ...) and Major (MajorID, MajorName, ...). I would like to get result: StuID, Name, MajorName. How to retrieve this record using ADO.Net Entity Data Model?

1
  • For this, I've tried: (from s in Entity.Student join m in Entity.Major on s.MajorID=m.MajorID select s, m.MajorName).ToList(); Commented Feb 14, 2012 at 7:00

1 Answer 1

1

I think that you are asking for C# LINQ query, if you are not, please ignore my anwser.

var result = from s in Student 
             join m in Major on s.MajorID equal m.MajorID
             select new {s.StuID, s.Name, m.MajorName}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.