Ado. NET Entity Data Model handling of database field default values

Source: Internet
Author: User
Tags visual studio 2010

Either Visual Studio 2010 or the 2013 built-in ADO Entity Data Model has a small problem: some fields in the database have default values set, but the ADO Entity Data Model tool is not set automatically.

You need to set it manually.

Assume that the Registerdate field in our SQL Server database has the default value GETDATE () set. After generating the edmx file with the ADO Entity Data Model, open the EDMX file, right-click Registerdate, select the Properties menu, modify the value of the Stroregeneratedpattern property in the Properties panel to Computeed:

When the operation is complete, click Save. The data model classes are automatically regenerated.

Ado. NET Entity Data Model handling of database field default values

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.