Question # 1 ends with "[besides the Entity structure], what are my options?" and you got the answers to this in the comments (direct ADO.NET or NHibernate). You also know that since you said you were using SqlCommand.
Question # 2 is difficult, and I think this is what your instructor wants you to find out: "What is the best way / approach in Winforms to view and edit relational data?"
I use a ton of user interface for relational data using Microsoft Stack. But regardless of technology, you need a good template or method. The short answer (this is not a book) is to abstract data from the user interface. Thus, they can operate independently and also independently of each other.
First, implement the editing data and display the data should be two different parts of your program. One method that I like is to select the relationship data from SQL SERVER as XML, and then use XSLT to display it:
<Customer> <Name>... <Company>... <Phone>... <BillingAddresses> <Address>... <Address>... <PayementMethods> <CreditCard>... <CreditCard>... <RecentOrders> <Order>... <Order>... <Order>...
You can use XSLT to easily do this in HTML, which looks just the way you want it. In this example, next to where you show each <Address> and <CreditCard> , you can place the EDIT / DELETE links along with the ADD links under each section.
By clicking EDIT / DELETE / ADD, you will be taken to the screen to modify this piece of relational data. When you return to the screen displaying XML as HTML, you will see updated data.
This is good because you can easily change your XML without recompiling the code. You can also use XSLT to display your data in any layout you want. Then your XML can include literals for what is stored as codes (AMX = AMERICAN EXPRESS, etc.).
Anywho, this is just one solution without real requirements (for example, support for "UNDO", the simultaneous application of several changes, etc.).
source share