The database design of ASP. NET MVC4.0 Development CMS system case

Source: Internet
Author: User

Starting from this chapter, the process of developing an article management system is documented, and the process of developing software generally includes the following aspects:

1, needs research, understand the system function demand target.

2, analysis and design, according to the research content analysis of how to achieve customer requirements, and design system function module.

3, data design, determine the function of the corresponding database, data tables, data fields, data relations, etc.

4, Code development, implementation of various functional modules.

5, the integration of art, the background of the business functions to achieve with the foreground design of the Web page together, and do a good job optimization.

6, System testing, check system bugs, and performance tests.

7, on-line release, official use.

As we are mainly for learning and research MVC Architecture Technology, so business analysis does not need to do too much description, the overall front desk has user login, user registration, article display, article reading, user article management, personal information management. Backstage includes: User management, article Management, column management, Rights Management. The amount of Bureau design we first take the user information table as the example below:

I. Creating a database SQL statement

Create DATABASE [Hillstonecmis] on primary (name = N ' [hillstonecmis] ', filename = n ' d:\Cemis database\hillstonecmis.mdf ', Size = 3072kb, maxsize= unlimited,filegrowth=1024kb) Log on (name = N ' Hillstonecmis_log ', filename=n ' D:\Cemis Database\hi Llstonecmis_log.ldf ', size=1072kb,maxsize=2048gb,filegrowth=10%)

Includes the database main file MDF and log file Log,name represents the database name, FileName creates the physical address of the data, the size of the data, the size of the growth, and so on.

Second, set the database compatibility, components and other environment configuration

ALTER DATABASE [Hillstonecmis] SET compatibility_level = All GO

To set the compatibility level for a specific database, 80, 90, and 100 represent SQL Server 2000, SQL Server 2005, and SQL Server 2008, respectively.

IF (1 = fulltextserviceproperty (' isfulltextinstalled ')) begin

Installs the full-text component in the current instance of SQL Server. 0 = Full-text components are not installed. 1 = full-text components are installed. NULL = Invalid input or an error occurred.

EXEC [Hillstonecmis]. [dbo]. [sp_fulltext_database] @action = ' Enable ' End GO


Initializes the full-text index, or removes all full-text catalogs from the current database. Enable = full-text indexing is enabled in the current database. Disable= for the current database, delete all full-text catalogs in the file system, and mark the database as disabled for full-text indexing.

4, other configuration, etc.

    alter database [hillstonecmis] set ansi_null_default off     go    alter database [hillstonecmis] set ansi_ nulls off    go    alter database [hillstonecmis]  set ansi_padding off    go    alter database [ Hillstonecmis] set ansi_warnings off    go    alter  DATABASE [HillstoneCMIS] SET ARITHABORT OFF    GO     ALTER DATABASE [HillstoneCMIS] SET AUTO_CLOSE ON     go    alter database [hillstonecmis] set auto_create_statistics  on    go    alter database [hillstonecmis] set  auto_shrink off     go    alter database [hillstonecmis] set auto_update_ Statistics on    go    alter database [hillstonecmis]  SET CURSOR_CLOSE_ON_COMMIT OFF    GO    ALTER  database [hillstonecmis] set cursor_default  global    go     alter database [hillstonecmis] set concat_null_yields_null off     GO    ALTER DATABASE [HillstoneCMIS] SET  numeric_roundabort off    go    alter database [ Hillstonecmis] set quoted_identifier off    go    alter  DATABASE [HillstoneCMIS] SET RECURSIVE_TRIGGERS OFF    GO     alter database&nBsp [Hillstonecmis] set  disable_broker    go    alter  DATABASE [HillstoneCMIS] SET AUTO_UPDATE_STATISTICS_ASYNC OFF     go    alter database [hillstonecmis] set date_correlation_ Optimization off    go    alter database [hillstonecmis ] set trustworthy off    go    alter database  [HillstoneCMIS] SET ALLOW_SNAPSHOT_ISOLATION OFF    GO     ALTER DATABASE [HillstoneCMIS] SET PARAMETERIZATION SIMPLE     go    alter database [hillstonecmis] set read_committed_ Snapshot off    go    alter database [hillstonecmis]  set honor_broker_priority&nBsp;off    go    alter database [hillstonecmis] set   read_write    go    alter database [ hillstonecmis] set recovery simple    go    alter  database [hillstonecmis] set  multi_user    go     Alter database [hillstonecmis] set page_verify checksum    go     ALTER DATABASE [HillstoneCMIS] SET DB_CHAINING OFF     go    use [hillstonecmis]    go


5. Create user data tables and their field annotations

    SE [HillstoneCMIS]    GO    /******  OBJECT:  TABLE [DBO]. [syscomuser]    script date: 11/19/2014 14:53:56 ******/     IF  EXISTS  (select * from sys.objects where object_id  = object_id (N ' [dbo].[ Syscomuser]  AND type in  (N ' U '))         drop  TABLE [DBO]. [Syscomuser]    go    create table syscomuser (         [userid] [int] identity ( NOT NULL,  )       [loginname] [varchar] ( NOT NULL,    )     [username] [varchar] ( NOT NULL,      )   [password] [varchar] ( n)Ull,        [orderno] [varchar] ( NULL,   )      [UserType] [int] NULL,         [Flag] [int] null,        [unitid] [int] null,         [PosId] [int] NULL,         [createduserid] [int] null,        [ Createdusername] [varchar] ( null,        [createddate)  [smalldatetime] null,        constraint [pk_syscomuser ] primary key clustered          ([CreatedDate]  ASC) with  (pad_index  = off, statistics_norecompute  = off,  Ignore_dup_key = off,  allow_row_locks  = on, allow_page_locks  = on)  ON [PRIMARY ]    )  ON [PRIMARY]        GO         SET ANSI_PADDING OFF    GO         EXEC sys.sp_addextendedproperty  @name =n ' ms_description ',  @ Value=n ' User ID '  ,  @level0type =n ' SCHEMA ', @level0name =n ' dbo ',  @level1type =n ' TABLE ', @level1name =n ' Syscomuser ',  @level2type =n ' COLUMN ', @level2name =n ' UserId '     GO         EXEC sys.sp_addextendedproperty  @name =n ' ms_description ',  @value =n ' Login name '  ,  @level0type =n ' SCHEMA ', @level0name =n ' dbo ',  @level1type =n ' TABLE ', @level1name =n ' Syscomuser ',  @level2type =n ' COLUMN ', @level2name =n ' LoginName '     GO         exec sys.sp_addextendedproperty  @name =n ' ms_description ',  @value =n ' user name '  ,  @level0type =n ' SCHEMA ', @level0name =n ' dbo ',  @level1type =n ' TABLE ', @level1name =n ' syscomuser ',  @level2type =n ' COLUMN ', @ Level2name=n ' UserName '     GO        EXEC  sys.sp_addextendedproperty  @name =n ' ms_description ',  @value =n ' password '  ,  @level0type =n ' SCHEMA ', @ Level0name=n ' dbo ',  @level1type =n ' TABLE ', @level1name =n ' syscomuser ',  @level2type =n ' COLUMN ', @level2name =n ' Password '     go        exec sys.sp_ addextendedproperty  @name =n ' ms_description ',  @value =n ' sort '  ,  @level0type =n ' SCHEMA ', @ Level0name=n ' dbo ',  @level1type =n ' TABLE ', @level1name =n ' syscomuser ',  @level2type =n ' COLUMN ', @level2name =n ' OrderNo '     go        exec sys.sp_ addextendedproperty  @name =n ' Ms_descRiption ',  @value =n ' user type '  ,  @level0type =n ' SCHEMA ', @level0name =n ' dbo ',  @level1type =n ' TABLE ', @level1name =n ' syscomuser ',  @level2type =n ' COLUMN ', @level2name =n ' usertype '     GO         EXEC sys.sp_addextendedproperty  @name =n ' ms_description ',   @value =n ' status '  ,  @level0type =n ' SCHEMA ', @level0name =n ' dbo ',  @level1type =n ' TABLE ', @level1name =n ' Syscomuser ',  @level2type =n ' COLUMN ', @level2name =n ' Flag '     GO         EXEC sys.sp_addextendedproperty  @name =n ' ms_description ',  @value =n ' Creator ID '  ,  @level0type =n ' SCHEMA ', @level0name =n ' dbo ',  @level1type =n ' TABLE ', @level1name =n ' Syscomuser ',  @level2type =n ' COLUMN ', @level2name =n ' Createduserid '     GO         EXEC sys.sp_addextendedproperty  @name =n ' ms_description ',  @ Value=n ' creator '  ,  @leveL0type=n ' SCHEMA ', @level0name =n ' dbo ',  @level1type =n ' TABLE ', @level1name =n ' syscomuser ',  @level2type =n ' COLUMN ', @level2name =n ' Createdusername '     GO         EXEC sys.sp_addextendedproperty  @name =n ' ms_description ',  @value =n ' creation time '  , @ Level0type=n ' SCHEMA ', @level0name =n ' dbo ',  @level1type =n ' TABLE ', @level1name =n ' Syscomuser ',  @level2type =n ' COLUMN ', @level2name =n ' CreatedDate '     GO         EXEC sys.sp_addextendedproperty  @name =n ' ms_description ',  @value =n ' users '  , @ Level0type=n ' SCHEMA ', @level0name =n ' dbo ',  @level1type =n ' TABLE ', @level1name =n ' Syscomuser '      go


After the execution is complete, modify the Web. config configuration.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/53/BB/wKioL1RuphqC53clAADYoaRtT7c214.jpg "width=" 793 " height= "title=" Qq20141121103520.jpg "border=" 1 "alt=" wkiol1ruphqc53claadyoartt7c214.jpg "/>

Data Link display in Server Resource management:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/53/BB/wKioL1RupvCg7coEAAIRctywJo8474.jpg "title=" Qq20141121103940.jpg "width=" 621 "height=" 385 "border=" 1 "hspace=" 0 "vspace=" 0 "style=" width:621px;height:385px; "alt = "Wkiol1rupvcg7coeaairctywjo8474.jpg"/>

This article from "Run small snail-original Space" blog, reproduced please contact the author!

The database design of ASP. NET MVC4.0 Development CMS system case

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.