Manually changing username in Asp.Net Membership
<p>I am able to change a username by directly accessing the asp.net membership user tables.  However, the old username is preserved in a new row and assigned a new UserID automatically by asp.net.  How do I stop that from happening?</p>

<p><strong>EDIT: only in the users table and roles table, not the membership table.</strong></p>

<pre><code>var mUser = dc.aspnet_Users
            .Where(u =&gt; u.UserId == (Guid)user.ProviderUserKey)
            .Select(u =&gt; u).SingleOrDefault();

mUser.UserName = newName;
mUser.LoweredUserName = newName.ToLower();

try
{
    dc.SubmitChanges();
}
catch
{
    ...
}
</code></pre>
