Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 514421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:31:23+00:00 2026-05-13T07:31:23+00:00

I know how to mark a group of fields as primary key in ADO.NET

  • 0

I know how to mark a group of fields as primary key in ADO.NET entities but i haven’t found a way to declare unique constraints or check constraints.

Is this feature missing on the designer or on the framework?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:31:23+00:00Added an answer on May 13, 2026 at 7:31 am

    Support for unique keys/constraints does not exist in ADO.NET Entities in v4.0, see the answer to “one-to-one association on a foreign key with unique constraint“, where Diego B Vega says:

    I know for sure we haven’t added
    support for unique keys other than
    primary keys in 4.0.

    He does, however, provide a possible workaround/hack (which comes with all the normal caveats):

    As you are probably aware of, it is
    often possible to “lie” to Entity
    Framework and tell it in the SSDL, for
    instance, that some unique key is the
    primary key. I reckon this would work
    very well if the actual primary key is
    an surrogate key (i.e. an IDENTITY
    column that was added for this
    purpose) and you don’t even have to
    map it in the model.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know you can not set a key value dynamically, but what about the
I know that you can mark a scala object as @serializable , but I
Definitions lists are a great way to mark up information where some key word
I'm trying to delete the mark ' (single quote) but I dont know how.
We understand the hash is for AJAX searches, but the exclamation mark? Anyone know?
Suppose you have a module that you know is safe. You want to mark
Know this might be rather basic, but I been trying to figure out how
I know that Phonegap has an event for back button, but it's only available
I know that this sort of question has been asked here before, but still
i know this is a stupid question but i d'ont know how to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.