I will start my work later. However, before that, I 'd like to tell you what to pay attention to in this tutorial:
Design intent: When you see this title, you need to know what to achieve and how to achieve it. It is very important to clarify the idea of establishing a program, know how to design it, and what solutions should be used by a program designer.
Do it with me: when you see this title, you must switch the window and follow the step by step picture and text instructions to do it step by step. Only in this way can you master various operations.
Code Description: This part explains the meaning of some code.
Code omitted: many similar codes and database data are not completely displayed in step by step. If they are omitted, let everyone practice on their own, some things are complicated, such as database data, which can be solved by downloading code.
Section 1: underlying database creation
Design intent:
The. NET University has five teams to participate in this basketball competition. Each team consists of 7-9 players (some teams have more substitutes ). We need to create two tables to store the data. One is about the department table of each team, which is used to store the team's data; the other is the player table, which stores the players' data. If you are familiar with basketball, you can imagine which fields need to be designed.
Do it with me:
Open the vWD Point file and create a new website named dotnetbg (. netbasketballgame ).
Right-click the website directory on the right and choose "Add new project: SQL database" and name it "basketballgame. MDF ".
Select the data Resource Manager tab in the lower right corner (some layout may be in the middle of the right), right-click the "table" folder and right-click to add a new table. Enter the field name and type as follows:
Then, right-click the playerid field and choose set as primary key.
Code omitted:
After completing these steps, you can download the code to obtain all the field settings of the table and the data in the table. These steps are cumbersome, however, we hope that you have set at least five fields by yourself and learn to set up a primary key before downloading it.
This instance database downloads the player team Database
I'm glad that you have completed the first section. That's right. It's very simple and easy, and you don't need to write any code.
Of course, I have not introduced in detail how to design a database, such as the field type, default value, and design philosophy. You can refer to the relevant books for details here.
In the future, you may obtain a ready-made database. You can drag a database from the folder to the app_data folder of the website and start the next step.