Windows phone Local Database (SQLCE): 3, [Table]attribute (translation)

Source: Internet
Author: User

This is the third installment of the "Windows Phone Mango Local Database (SQLCE)" series of short articles. To get you started using the database in Windows Phone Mango, this series of short film articles will cover all the knowledge you need to know. This time I will talk about you using the Windows Phone Mango Local Database when you use [Table]attribute.

1. [What is Table]attribute?You can use this property to specify a class as an entity class related to a database table or view. LINQ to SQL will have a class of this property as a persisted class. You can use the Name property of the Tableattribute property to specify the name of a table, and you can use the schema name to qualify the name of the table. If you do not use the name attribute to specify a name, the table name defaults to the same as the class name. In addition to associating a class to a table, you need to indicate each field or property that you intend to associate to the data table column. Note : LINQ to SQL supports only single table mappings. That is, an entity class must be correctly mapped to a database table, and you cannot map multiple entity classes to a single database table at the same time. 2. How to use [Table]attributeExample 1: A table with a name
"countries")]class country{//class contents here5}   

Example 2: Table without a name

[Table]   class country{//class contents here5}     
  This article I talked about using [Table] attribute in the Windows Phone Mango Local database. 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.