Windows phone Local Database (SQLCE): 1, Introduction (translation)

Source: Internet
Author: User
Tags compact

A big rookie, recently to learn the Windows Phone database related knowledge, found some relatively short tutorials to learn, because it is in English, by the way to translate. Their English level is not good, estimated that there are many errors in the text, if there are unfortunate to read the children's shoes please maintain the quality of the translation of the question, a lot of advice.

This is the original address: Http://windowsphonegeek.com/tips/Windows-Phone-Mango-Local-Database%28SQL-CE%29-Introduction

The text reads as follows:

I started a new series--windows Phone Mango Local Database (SQLCE). To get you started using the database in Windows Phone Mango, this series of short articles will cover all the knowledge points you need to know. This series contains the following content:

Windows Phone Mango Local Database (SQL CE): Introduction
  • Windows Phone Mango Local Database (SQL CE): Linq to SQL
  • Windows Phone Mango Local Database (SQL CE): [Table] Attribute
  • Windows Phone Mango Local Database (SQL CE): [Column] Attribute
  • Windows Phone Mango Local Database (SQL CE): [Association] attribute
  • Windows Phone Mango Local Database (SQL CE): [Index] Attribute
  • Windows Phone Mango Local Database (SQL CE): Database mapping
  • Windows Phone Mango Local Database (SQL CE): DataContext
  • Windows Phone Mango Local Database (SQL CE): Connection Strings
  • Windows Phone Mango Local Database (SQL CE): Creating the Database
  • Windows Phone Mango Local Database (SQL CE): Database Queries with LINQ
  • Windows Phone Mango Local Database (SQL CE): How to Insert data
  • Windows Phone Mango Local Database (SQL CE): How to Update data
  • Windows Phone Mango Local Database (SQL CE): How to Delete data

This is the first article in this series, and I'll give you a brief introduction to the local database, in addition to what you need to know before you start using the SqlCe database in the Windows Phone Mango application.

1. What is a local database?

First, when you first talk about Windows Phone Mango, you can now save the relational data to the local database in IsolatedStorage. In Windows Phone, all applications are "isolated" from each other, meaning that a program can only access its own isolatedstorage, where a database can only be applied to one application and cannot be shared among several applications.

The local database in Windows Phone is an implementation of the SQL compact about Mango. This is a relational database management system (RDB MS) on memory/embedded. The local database is well suited for scenarios with relational entities (related entities). For example: Customers and orders.

The following scenario is ideal for using a local database:1, more relations table/entity, containing the appropriate amount of records (moderate)2. A few tables containing a large number of records or data3. Locally cached data from cloud computinga local database has the following advantages:1. The ability to use complex queries in the database to become more efficient and fast2. Allow data to be loaded into memory at certain times (this sentence really does not know how to translate just fine)3, can do some operations, such as: Add, remove, insert, delete, all of these operations are processed efficiently through the SQL Compact runtime
In order to use the local database in Windows Phone, you need to be aware of the following steps 1. Implement all database classes: tables (table), Columns (column), relations (relationship), DataContext, etc.2. Build a new database (. sdf) file in IsolatedStorage (the database is empty by default)3. Populate this database with data in IsolatedStorage

before you start, there are 8 things you need to know about SQL CE1. LINQ to SQL is used as an ORM engine2. Database files are stored in IsolatedStorage3. Linq is often used for querying data and does not support T-SQL4. There is no need to allocate assemblies to increase the size of the application, and support for the Windwosphonemango local database is part of the framework. 5. System.Data.Linq This assembly must be added to the project6, use a special format of the connection string, such as this example: "Data source= ' isostore:/directory/file.sdf '";7, Windows Phone Mango This version uses code first method to define the database schema is preferred, that is, there is no visual designer at this time to help developers to map and configure the classes they use to process the database (so you have to write down all the classes). However, you can use a few tools, such as: Use SQLMetal to generate Windows Phone Mango Local database classes,http://windowsphonegeek.com/articles/ Using-sqlmetal-to-generate-windows-phone-mango-local-database-classes 8. Minimum requirements: Visual Studio SP1 and Windows Phone 7.1 Mango Developer ToolsYou can also refer to the MSDN documentation:http://msdn.microsoft.com/zh-cn/library/hh202860 (v=vs.92). aspx This is a short introduction to the article "Windows Phone Mango Local Database (SQLCE)" series. Keep your eye on the next article.
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.