title: Users added (via SQL trigger) from another database not showing in /OrchardLocal/Admin/Users
body: <p>In our membership database we have a trigger that fires when a new user is added. This trigger writes user-related information to our Orchard database (on same server) and populates the following tables correctly: </p>
  
  <ul>
  <li><code>Orchard_Framework_ContentItemRecord</code></li>
  <li><code>Orchard_Framework_ContentItemVersionRecord</code></li>
  <li><code>Orchard_Users_UserPartRecord</code></li>
  </ul>
  
  <p>The trigger does not populate <code>Orchard_Roles_UserRolesPartRecord</code> but to be sure this wasn't the issue after the trigger had fired I added the inserted record's Id to <code>Orchard_Roles_UserRolesPartRecord</code> and assigned a role - the problem persisted.</p>
  
  <p><strong>The problem</strong></p>
  
  <p>When I log in as an admin user and go to the <code>Users</code> page, none of the users added via the trigger are showing up. For example, if there was 1 admin user and 1 user added via the trigger, on the <code>Users</code> page I would just see the admin user, <em>however</em>, the label on the page would read 'Showing 1 - 2 of 2 users'. So it appears that when fetching users something is not satisfied and the user added via the trigger is not being added to view model.</p>
  
  <p>I have stepped through the code on the <code>AdminController</code>,</p>
  
  <pre><code>var users = Services.Query&lt;UserPart, UserPartRecord&gt;();
  </code></pre>
  
  <p><code>users</code> object will contain 2 users as above. When this line is hit:</p>
  
  <pre><code>var results = users.Slice(pager.GetStartIndex(), pager.PageSize).ToList();
  </code></pre>
  
  <p><code>results</code> object will only have 1 user, the admin user. I'm guessing that I'm missing an entry in some table. To be sure I created a new user in Orchard and inspected the generated SQL in SQL Server profiler and from what I can see no other tables need to be populated, however it seems that this is the case. Based on what I've said , can you identify anything I'm missing?</p>
  
  <p><em>Note:</em><br>
  I have also used the import/export module to export users and for the two user records in question following are results (where orchard_test is user added via trigger):</p>
  
  <pre><code>  &lt;Data&gt;
      &lt;User Id="/User.UserName=admin" Status="Published"&gt;
        &lt;UserPart Email="" EmailStatus="Approved" HashAlgorithm="SHA1" NormalizedUserName="admin" Password="H0+uhIHB0dI2QSPETgqFM9dyRV4=" PasswordFormat="Hashed" PasswordSalt="H4jlZb9da7SJQj6hyQnxBA==" RegistrationStatus="Approved" UserName="admin" /&gt;
        &lt;UserRolesPart Roles="" /&gt;
      &lt;/User&gt;
      &lt;User Id="/User.UserName=orchard_test" Status="Published"&gt;
        &lt;UserPart Email="orchard_test@test.com" EmailStatus="Approved" HashAlgorithm="SHA1" NormalizedUserName="orchard_test" Password="sbCvRgQj8cRlc7YMAiW17fhTQlfXhZWHoaWyK40/DSY=" PasswordFormat="Hashed" PasswordSalt="PQSlEKDdfcbi04EpyKXfqQ==" RegistrationStatus="Approved" UserName="orchard_test" /&gt;
        &lt;UserRolesPart Roles="" /&gt;
      &lt;/User&gt;
    &lt;/Data&gt;
  </code></pre>