Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
6
Answers
Linq to SQL
Amit Joshi
9y
638
1
Reply
I am using entity framework and Linq to fetch the data.
I have to tables Product and Order Detail. In Order detail table I have order Id and Product Id. While displaying data in gridview I am fetching data from order detail table. But I don't want to show Product Id in the grid. Instead of that I want to show related product name from product table.
I have EDMX file which has created two classes Product and Order detail. I am using LINQ to fetch data from Order details table. How can I get Product Name of related product ID. Method return type can not be Order detail. It gives me below error.
Cannot implicitly convert type 'System.Linq.IQueryable<AnonymousType#1>' to 'System.Collections.Generic.List<OrderDetail>
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
Simple HTTPServer with C#
How to start nodejs server with visual studio.