Windows Phone local database (sqlce): 1. Introduction)

Source: Internet
Author: User
Tags visual studio 2010

A newbie recently wants to learn about the Windows Phone database and find some short tutorials. Because it is in English, it is translated by the way. The English level is not good. It is estimated that there are many mistakes in the text. If you have any children's shoes that are unfortunately read, please keep in doubt about the translation quality and give me more advice.

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

The text is as follows:

I started a new series-Windows Phone mango local database (sqlce ). To get you started using databases in Windows Phone mango, this series of short articles will cover all the things you need to know. This series includes 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. I will give a brief introduction to the local database. In addition, before using the sqlce database in the Windows Phone mango application, what you need to know.

1. What is a local database?

First, when talking 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, which means that a program can only access its own isolatedstorage, that is, a database can only be applied to one application, it cannot be shared among several applications.

The local database in Windows Phone is an implementation of mango in SQL compact. This is a memory/Embedded Relational Database Management System (rdb ms ). The local database is very suitable for related entities. For example, customers and orders.

The following scenarios are very suitable for using local databases: 1. A large number of Relational Tables/entities, including a proper amount of records (not small) 2. A few tables that contain a large number of records or data. 3. Locally cached data from a cloud computing Local database has the following advantages: 1. The ability to use complex queries in the database to become more efficient and fast 2. allow data to be loaded into the memory at a specific time point (I really don't know how to translate this sentence) 3. You can perform some operations, such as adding, removing, inserting, and deleting. All these operations are processed efficiently through SQL compact runtime.
To use a local database in Windows Phone, You need to note the following steps 1. Implement all database classes: tables (table), columns (column), relations (relationship ), datacontext, etc. 2. Create a new database (. SDF) file (by default, the database is empty) 3. Fill the database with data in isolatedstorage

Before you start, you need to know eight things about SQL ce. 1. using LINQ to SQL AS THE ORM engine. 2. database files are stored in isolatedstorage3 and commonly used for data query, support for windwosphonemango local databases is part of the framework, which does not support T-SQL4 and does not require Assembly allocation to increase the size of the application. 5. The system. Data. LINQ assembly must be added to the project. 6. Use a connection string in a special format. For example: "Data Source = 'isostore:/directory/file. SDF '";7. In Windows Phone mango, it is the first choice to define the database mode using the code-first method, that is, there is no visual designer to help developers map and configure the classes they use to process the database (so you have to write all the classes yourself ). But you can use some tools, such as: Use sqlmetal to generate Windows Phone mango local database class, http://windowsphonegeek.com/articles/Using-SqlMetal-to-generate-Windows-Phone-Mango-Local-Database-classes 8, minimum requirements: visual Studio 2010 SP1 and Windows Phone 7.1 mango developer tools you can also refer to the msdn documentation: http://msdn.microsoft.com/zh-cn/library/hh202860 (V = vs.92 ). aspx is a brief introduction to the "Windows Phone mango local database (sqlce)" series. Continue to follow the subsequent articles.

 

 

 

 
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.