简体   繁体   中英

How to display and update data in datagrid from multiple tables using EF and WPF?

I have following database schema.

数据库架构

Problem:I would like to retrieve data from multiple tables and display/edit it in a datagrid.

Description: I would like to get relevant data from all other tables using foreign key and display it to grid. For example there Delivery.TransporterID, now i want Transporter.TransporterName which can be navigated via TransporterID foreign key and display it along with delivery columns, same needs to be done with other foreign keys.

So user can view data and edit using the same datagrid. How to achieve this using C#,WPF database first and VS2012?

What you want to do is join the tables together and grab the results from the query. Here is a relevant article on using linq to accomplish the task. How to join tables in EF LINQ

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM