Processing of default database fields in the ADO. NET object data model, ado.net Fields

Source: Internet
Author: User

Processing of default database fields in the ADO. NET object data model, ado.net Fields

Whether it is Visual Studio 2010 or 2013 built-in ADO. NET Entity Data model has a small problem: some fields in the database have set the default value, but ADO. NET object data model tool does not automatically set.

In this case, you need to manually set it.

Assume that the default value getdate () has been set for the RegisterDate field in our SQL Server database (). After an edmx file is generated using the ADO. NET object data model, open the edmx file, right-click RegisterDate, select the attribute menu, and modify the value of StroreGeneratedPattern In the attribute panel to Computeed ,:

After the operation is complete, click Save. The data model class is automatically regenerated.

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.