The company has asked you to build a prototype of an n-tier system using the Northwind database as an example. The company wants to be able to add, edit, and delete records from the customers, orders, order details, products, categories, and suppliers tables. Your instructor will provide you the online link to the SQL Server database files (MDF and LDF).
Assignment Guidelines
Create the Data Access tier and Data tier projects:
Create a class library project for the Data tier.
Add a new class library project the project created in Step 1 for the data access tier.
Add a typed DataSet using a new data source that connects to the Northwind sample database.
Select the database objects (customers, orders, order details, products, categories, and suppliers) tables.
Make sure the TableAdapters are stored in the Data Access tier and the DataSet class is added to the Data tier.
More info:
Your main focus for learning this assignment is the tutorial "Walkthrough: Creating an N-Tier Data Application" from Microsoft. It's linked in the Learning Materials but I'll give you the link here as well:
https://msdn.microsoft.com/en-us/library/bb384570.aspx
Note that this tutorial is also available in video form!
https://go.microsoft.com/fwlink/?LinkId=115188
By default the above tutorial is for Visual Studio 2012, but if you look right under the title there is a hyperlink called "Other Versions" that will let you change the instructions for Visual Studio 2010. Note that there is still a small step missing in the steps where you connect the Northwind database, but just select "database" from that screen when it comes up and then continue with the tutorial.
Also, note that the tutorial leaves out a step that is required for C#. At the end of the section titled "Adding a Reference to the Data Entity and Data Access Tiers to the Data Service", you also need to add a .NET reference to System.Data.DataSetExtensions. (This is shown in the video, but not in the written tutorial.)
One last error in the tutorial. (Well not really an error, but the Framework has changed a bit since the tutorial was made.) At the end the instructions tell you to modify the maxReceivedMessage size parameter in app.config in the PresentationTier project. This parameter is no longer present in app.config by default, so you will have to add it manually (the program won't run without this). Use these steps:
- Locate the PresentationTier project in the solution explorer
- Open app.config
- Locate Configuration -> system.serviceModel -> bindings -> wsHttpBinding -> binding
- This property should only have one attribute (name). Add the following attribute right after name: maxReceivedMessageSize="64000000"
The completed property should look like this:
With this change the program should compile and run.
Once you have completed this tutorial you will know how to do the Unit 2 IP. The only difference is that the Unit 2 IP instructions call for you to make different tables available to the interface application. You DO NOT need to display all of these tables in the interface. Just create ONE Form and display ONE table's contents in a datagrid on that form, using the technique shown in the tutorial. Most of your grade will be based on the data sets, table adapters and references being able to access all of the tables listed in the assignment instructions. (That means you're going to have to modify a key step in the tutorial.)