[ASP. NET mvc3 practice tutorial] I. database design and project construction

Source: Internet
Author: User
Tags sql tutorial

 

First of all, this tutorial is used in combination with my writing of the LINQ to SQL tutorial. It is not just MVC, but also a practical practice of applying LINQ to SQL.


Link to the LINQ to SQL tutorial

 

 


I. Database Design


I. Preface

In my development, I personally think that the most important thing to do is not to use any language or UI. I think it is secondary to write data, I think the most important thing is the database design. After the database is designed, it means that you have an overall grasp of the entire system, and you are familiar with the opposite business, it also knows what features the customer needs and what needs to implement, so the subsequent encoding is not very difficult. (This is purely personal opinion. If there is anything wrong, please point out or study together !)

Ii. Database Design

First of all, it should be declared that the following database design should not be used in the production environment, but only for the purpose of learning MVC, so the design is unreasonable, and that is not a big problem. Of course, if someone points out the deficiencies, I will try to correct them.

First of all, we need to consider from the big aspect that the student achievement management system, so there must be a student, and there will be a class where there are students. Since it is a score management, there must be a score table, you must have a course schedule when you have a course schedule. Otherwise, how can you know the score. In this way, the database design idea of the simple Score Management System has come out.

The following is the database design of powerdesigner12.5.

The database is barely designed. Next, let's start building the project.

2. Project Construction

I. Development Environment

1. If you use mvc3 for development, you must use the vs2010 development platform. I will not talk about it much, or it will be too cool;

2. SQL Server 2005 is the most widely used database.

2. Project Construction

Use vs2010 to create a web project

Then select the intenet ApplicationProgramTo try razor.

OK. The basic project has been built. The following is the project resource manager.

After the project is created, you can see that many folders have been created by default. Here we will briefly describe the role of each folder.
Content-stores some resource files, fragments, and CSS required by the application.
Controllers -- stores the Controller class.
Models -- stores business model components.
Scripts -- stores Javascript script files.
Views -- stores views.
It doesn't matter if you don't know some concepts.ArticleIt will be explained slowly.

The project has been set up almost, so we will try to access the database by using LINQ to SQL, so we will add another LINQ to SQL class;

Are you sure you want to add, then open the server resource manager and create a data connection

Then, add the tables in the database to the LINQ to SQL class.

Okay. It doesn't mean the project has been set up here.

This article will show you and explain the next step.

Thank you for your support and attention to coolhots.CodeAh ~~

Add the project code:Mvctutorial .rar

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.