Solved

Entity Framework question  Part 2, asp.net

Posted on 2014-11-29
4
246 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
  • 2
  • 2
4 Comments
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 500 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 63

Expert Comment

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

830 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