Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Sørensen 102 posts 327 karma points
    May 13, 2015 @ 11:16
    Dan Sørensen
    0

    INSERT statement conflicted with the FOREIGN KEY

    enter image description here

    I'm uploading a lot of members and adding them to some member groups, but cant figure out why this happens.

    I have tried some different thinks like deleting the umbraco.config but this didn't help.

    thanks in advance for your help.

  • Dan Sørensen 102 posts 327 karma points
    May 13, 2015 @ 14:24
    Dan Sørensen
    0

    In the documentation https://our.umbraco.org/DOCUMENTATION/Reference/Management-v6/Services/MemberService

    .AssignRoles(int[] memberIds, string role);
    

    Assigns a role to multiple Members

    But in code

    .AssignRoles(int[] memberIds, string[] roles);
    

    Assigns multiple roles to multiple Members ?

    I Did a foreach loop instead like this below, and it worked.

      foreach (string role in newMemberGroups)
      {
           memberService.AssignRole(umbracoMemb.Id, role);
      }
    

    Dont know if this is a bug ?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies