Microsoft ASP. NET site deployment guide (2): deploy the SQL Server Compact database

Source: Internet
Author: User
Tags sql server express

1. Summary

For database access, the Contoso University program requires that the following software be deployed along with the program, because it does not belong to. NET Framework:

  • SQL Server Compact (database engine)
  • ASP. NET Universal Providers (enable ASP. NET membership to use SQL Server Compact)
  • Entity Framework 4.1 (Code First)

The database structure and related data of the two databases must be deployed. Generally, some test data is generated during system development. The test data cannot be deployed to the production environment. Of course, you may also need to enter data in the production environment for deployment to the production environment. This section describes how to configure the Contoso University project to include necessary software and data for deployment.

Reminder: check the Troubleshooting page if an error message or some functions are abnormal during operations in this section.

2. SQL Server Compact and SQL Server Express

The Sample program uses SQL Server Compact 4.0. This database engine is a new choice for web websites. The old version of SQL Server Compact cannot be used in the web environment. SQL Server Compact provides many common new functions, just like developing and deploying SQL Server Express and SQL Server. Depending on the host provider you choose, SQL Server Compact may be cheaper, because the full version of SQL Server requires additional charges. SQL Server Compact does not require additional fees because you can deploy the database engine as part of your program. Another advantage is that backup and restoration are very simple, because all the data is in A. sdf file in the app_data folder of the deployment site. Backup and restoration are just copy files.

 

However, you still need to pay attention to its limitations. SQL Server Compact does not support stored procedures, triggers, attempts, and replication. (For the complete list of functions supported by SQL Server 2005 and SQL Server 2008 but not supported by SQL Server Compact, visit: Differences Between SQL Server Compact and SQL Server ). Also, some tools that operate SQL Server Express and the full version of SQL Server database schema and data do not support SQL Compact. For example, you cannot use SQL Server Management Studio or Visual Studio database project to process SQL Server Compact databases. When you use SQL Server Compact, Entity Framework Code First automatically creates a database based on your data model. However, after deployment, it is very difficult to keep the development environment database and production environment database synchronized. It would be easy to use tools like SQL Server Management Studio.

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.