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 153559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:49:20+00:00 2026-05-11T09:49:20+00:00

I’m attempting to use ADO.NET Data Services to update my database. Tables: Person( PK

  • 0

I’m attempting to use ADO.NET Data Services to update my database.

Tables:

  • Person( PK PersonId; FK EntityRootId)
  • EntityRoot( PK EntityRootId, FK EntityTypeId)
  • EntityTypes( PK EntityTypeId)

I’m trying to create an EntityRoot (unfortunate name since it may be confused with Entity Framework’s Entity. EntityRoot is in my domain) and add it to the database:

var entRoot = EntityRoot.CreateEntityRoot(     0, 'Lou', DateTime.Now, 'Lou', DateTime.Now); var entityType =     (from type in myContext.EntityTypeSet     where (type.Description == 'Person')     select type).FirstOrDefault(); // this works fine and returns the entityType I’m looking for  entRoot.EntityType = entityType; myContext.AddToEntityRootSet(entRoot);   // with the line below I get a runtime error: //  “AddLink and DeleteLink methods only work when the sourceProperty is a collection.” //myContext.AddLink(entRoot, 'EntityType', entityType);   // without the line above I get an error from the save: //  “Entities in 'MyEntities.EntityRootSet' participate in the 'FK_EntityRoots_EntityTypeId_Lookup_EntityTypes'  //    relationship. 0 related 'EntityTypes' were found. 1 'EntityTypes' is expected.” myContext.BeginSaveChanges(SaveChangesOptions.Batch,                       new AsyncCallback(OnSaveAllComplete),                       null);  

How can I add a reference to the entRoot.EntityTypeId field?

Thanks for any insight into this.

  • 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. 2026-05-11T09:49:21+00:00Added an answer on May 11, 2026 at 9:49 am

    I think when doing this you should use SetLink instead of AddLink, because the property you are indicating is from Entity to EntityType (an Entity has one EntityType).

    This is basically what the error message is telling you (AddLink works only on Collection properties, like the reverse property from type to entity, or for many to many relationships).

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

Sidebar

Related Questions

I an attempting to use a SQLiteFunction from my C# and ADO.NET code. Can
I'm attempting to use the .NET System.DirectoryServices.AccountManagement library to obtain the UserPrincipal for a
I'm attempting to use the new partial page caching available in ASP.NET MVC 3.
I'm new to NHibernate and am attempting to use it to connect to DB2.
I'm part of a team building an ADO.NET based web-site. We sometimes have several
When attempting to use the TCPProxy tool included with The Grinder, I get the
I'm attempting to use both Perl's autoboxing functionality and operator overloading functionality, and they
I am attempting to use the crypt gem. While I am able to get
I am attempting to use OpenSSL's SHA512 function in a C++ project of mine.
I am attempting to use PyQT to position and display a custom widget. Thus

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.