Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Entity Framework question  Part 2, asp.net

Posted on 2014-11-29
4
Medium Priority
?
264 Views
Last Modified: 2014-11-29
As shown below, some customers have each zero or many orders. To do this, I added a template field (Orders) and inserted a gridview in it with Bindings Eval("tblOrders"). I also entered  tblOrders to Include property of EntityDataSource1 .EF_5
But in the case of Items template field, after setting  Bindings Eval("tblOrderDetails"), I do not know where and how to add tblOrderDetails so the Include property?

I am trying to display Order Details (Items) or each order. The project solution (EF_YouTube.zip about 1.1 MB with db file in it is at:  https://onedrive.live.com/?cid=420CDD6A13807C9B&id=420CDD6A13807C9B%21116 for additional information. It is developed in vs2012 and uses SQLEXPRESS12)

Question: How can I make this application to show Order_Details (Items) as well?EF6
0
Comment
Question by:Mike Eghtebas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 40471694
Hi eghtebas;

I am not an ASP.Net developer and so I did not know how to modify this property using the smart tabin the designer so I modifyed it directly in tthe HTML.

The Include attribute needs to be modified to include all the tables you wish included. All path to a table must start from the main source which in this case is tblCustomers. So to include order details using a comma separated list of paths in the Include string you add tblOrders.tblOrderDetails as shown below.

<asp:EntityDataSource ID="EntityDataSource1" 
                      runat="server" 
                      ConnectionString="name=OrderModel" 
                      DefaultContainerName="OrderModel" 
                      EnableFlattening="False" 
                      EntitySetName="tblCustomers" 
                      Include="tblOrders, tblOrders.tblOrderDetails">
</asp:EntityDataSource>

Open in new window


The results of the change
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 40471726
You are amazing. Thank you very much. The last part will be to use title from tblSoftware. I will post the question shortly.

Mike
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 40471770
The new question is at:  http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_28571494.html

If you have the time to take a look at it.

Thanks,

Mike
0
 
LVL 64

Expert Comment

by:Fernando Soto
ID: 40471800
Not a problem Mike, always glad to help.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question