<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx</link><description>Profile.UserName is a readonly field. So, how do you change a user&amp;#39;s name? Many use email address as user name (like us, Pageflakes) and we want to allow users to change their email address which in turn changes their user name. So, how do you do</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1716649</link><pubDate>Wed, 19 Aug 2009 13:50:15 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1716649</guid><dc:creator>Marwan Roushdy</dc:creator><description>&lt;p&gt;Here is a C# version of Doug&amp;#39;s plus corrected some issues regarding finding the username because sometimes it could not be available in web.config.&lt;/p&gt;
&lt;p&gt;///////////////////////&lt;/p&gt;
&lt;p&gt; public class utils&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public static bool ChangeUserName(string oldUserName,string newUserName)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bool IsSuccsessful = false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string ApplicationName;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(IsUserNameValid(newUserName))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ((ConfigurationManager.ConnectionStrings[&amp;quot;applicationName&amp;quot;] == null) || String.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[&amp;quot;applicationName&amp;quot;].ToString()))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ApplicationName = System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ ApplicationName = ConfigurationManager.ConnectionStrings[&amp;quot;applicationName&amp;quot;].ToString(); }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SqlConnection myConn = new SqlConnection(ConfigurationManager.ConnectionStrings[&amp;quot;ApplicationServices&amp;quot;].ToString());&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmdChangeUserName= new SqlCommand();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmdChangeUserName.CommandText=&amp;quot;dbo.aspnet_Membership_ChangeUserName&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmdChangeUserName.CommandType = CommandType.StoredProcedure;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmdChangeUserName.Connection = myConn;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmdChangeUserName.Parameters.Add(&amp;quot;@ApplicationName&amp;quot;, SqlDbType.NVarChar);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmdChangeUserName.Parameters.Add(&amp;quot;@OldUserName&amp;quot;, SqlDbType.NVarChar);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmdChangeUserName.Parameters.Add(&amp;quot;@NewUserName&amp;quot;, SqlDbType.NVarChar);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmdChangeUserName.Parameters[&amp;quot;@ApplicationName&amp;quot;].Value = ApplicationName;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmdChangeUserName.Parameters[&amp;quot;@OldUserName&amp;quot;].Value = oldUserName;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmdChangeUserName.Parameters[&amp;quot;@NewUserName&amp;quot;].Value = newUserName;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myConn.Open();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmdChangeUserName.ExecuteNonQuery();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myConn.Close();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IsSuccsessful = true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;catch(Exception ex )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{IsSuccsessful = false;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else{IsSuccsessful = false;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return IsSuccsessful;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;private static bool IsUserNameValid(string username)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Add whatever username requirement validation you want here, doesnt&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//the membership provider have some build in functionality for this?&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1716649" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1672990</link><pubDate>Fri, 20 Feb 2009 09:58:54 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1672990</guid><dc:creator>D-Ball</dc:creator><description>&lt;p&gt;Here is the VB version of Thomas&amp;#39; code...&lt;/p&gt;
&lt;p&gt;1. Make sure New UserName is Unique&lt;/p&gt;
&lt;p&gt;2. Update the aspnet_Users table directly&lt;/p&gt;
&lt;p&gt;3. Execute to following code to change the username/cookie/identity without leaving the webpage...&lt;/p&gt;
&lt;p&gt;&amp;#39; Obtains the name of the FormsAuthentication Cookie, uses that name to request the Cookie and Decrypts the Cookies information into a AuthTicket&lt;/p&gt;
&lt;p&gt;Dim AuthTicket As FormsAuthenticationTicket = FormsAuthentication.Decrypt(HttpContext.Current.Request.Cookies(FormsAuthentication.FormsCookieName).Value)&lt;/p&gt;
&lt;p&gt;&amp;#39; Instantiates a new user identity authenticated using forms authentication based on the FormsAuthenticationTicket.&lt;/p&gt;
&lt;p&gt;&amp;#39; The FormsAuthenticationTicket has been created using the exact same parameters of the user with the Old Username except the Old Username has been updated with the New Username.&lt;/p&gt;
&lt;p&gt;Dim NewFormsIdentity As New FormsIdentity(New FormsAuthenticationTicket(AuthTicket.Version, NewUsername, AuthTicket.IssueDate, AuthTicket.Expiration, AuthTicket.IsPersistent, AuthTicket.UserData))&lt;/p&gt;
&lt;p&gt;&amp;#39; Parse out the AuthTicket&amp;#39;s UserData into a string array of Roles&lt;/p&gt;
&lt;p&gt;Dim Roles As String() = AuthTicket.UserData.Split(&amp;quot;|&amp;quot;.ToCharArray)&lt;/p&gt;
&lt;p&gt;&amp;#39; Creates a new user that has the NewFormsIdentity and belongs to the array of Roles, if any, that was stored in the FormsAuthenticationTicket&lt;/p&gt;
&lt;p&gt;Dim NewGenericPrincipal As New System.Security.Principal.GenericPrincipal(NewFormsIdentity, Roles)&lt;/p&gt;
&lt;p&gt;&amp;#39; Sets the security information for the current HTTP request to the new user. &amp;nbsp;The Username has now been changed (i.e. HttpContext.Current.User.Identity.Name = NewUsername, prior to this step is was the OldUsername)&lt;/p&gt;
&lt;p&gt;HttpContext.Current.User = NewGenericPrincipal&lt;/p&gt;
&lt;p&gt;&amp;#39; Removes the forms-authentication ticket from the browser&lt;/p&gt;
&lt;p&gt;FormsAuthentication.SignOut()&lt;/p&gt;
&lt;p&gt;&amp;#39; Cancels the current session&lt;/p&gt;
&lt;p&gt;HttpContext.Current.Session.Abandon()&lt;/p&gt;
&lt;p&gt;&amp;#39; Creates an authentication ticket for the supplied New Username and adds it to the cookies collection of the response or the URL&lt;/p&gt;
&lt;p&gt;FormsAuthentication.SetAuthCookie(HttpContext.Current.User.Identity.Name, AuthTicket.IsPersistent)&lt;/p&gt;
&lt;p&gt;4. Response.Redirect back to the same page if needed.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1672990" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1672989</link><pubDate>Fri, 20 Feb 2009 09:50:52 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1672989</guid><dc:creator>D-Ball</dc:creator><description>&lt;p&gt;Thomas, your code works great. &amp;nbsp;Thanks!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1672989" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1656505</link><pubDate>Thu, 11 Dec 2008 16:40:26 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1656505</guid><dc:creator>muadib</dc:creator><description>&lt;p&gt;Thanks to Omar, Doug Taylor and Thomas&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1656505" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1649086</link><pubDate>Sun, 28 Sep 2008 11:23:11 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1649086</guid><dc:creator>codebounce.com</dc:creator><description>&lt;p&gt;Hellons!&lt;/p&gt;
&lt;p&gt;I stumbled upon this and thought was very useful. My only concern as someone already pointed out: updating all references to the old id.&lt;/p&gt;
&lt;p&gt;In spite of this, still useful.&lt;/p&gt;
&lt;p&gt;I also bookmarked it:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.codebounce.com/ASPNET"&gt;www.codebounce.com/ASPNET&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1649086" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1453840</link><pubDate>Thu, 10 Jan 2008 22:49:14 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1453840</guid><dc:creator>sweetpea-hk</dc:creator><description>&lt;p&gt;&amp;lt;a href= &lt;a rel="nofollow" target="_new" href="http://gener4.com"&gt;http://gener4.com&lt;/a&gt; &amp;gt;golden valley cabin rentals&amp;lt;/a&amp;gt; &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1453840" width="1" height="1"&gt;</description></item><item><title>Where is the ChangeUserName() function?</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1316063</link><pubDate>Thu, 15 Nov 2007 17:21:54 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1316063</guid><dc:creator>Dev by Doug</dc:creator><description>&lt;p&gt;I recently built a site that uses the Microsoft ASP.NET Membership, Role and Profile providers (2.0 framework&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1316063" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1313297</link><pubDate>Thu, 15 Nov 2007 02:06:42 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1313297</guid><dc:creator>Alexqgr</dc:creator><description>&lt;p&gt;&amp;lt;a href= &amp;nbsp;&amp;gt;&amp;lt;/a&amp;gt; &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1313297" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1313296</link><pubDate>Thu, 15 Nov 2007 02:06:38 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1313296</guid><dc:creator>Alexwvg</dc:creator><description>&lt;p&gt;&amp;lt;a href= &amp;nbsp;&amp;gt;&amp;lt;/a&amp;gt; &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1313296" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1313295</link><pubDate>Thu, 15 Nov 2007 02:06:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1313295</guid><dc:creator>Alexyqf</dc:creator><description>&lt;p&gt;&amp;lt;a href= &amp;nbsp;&amp;gt;&amp;lt;/a&amp;gt; &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1313295" width="1" height="1"&gt;</description></item><item><title>Where's the ChangeUserName() function?</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1307654</link><pubDate>Tue, 13 Nov 2007 21:59:41 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1307654</guid><dc:creator>Code Journal .NET</dc:creator><description>&lt;p&gt;Where's the ChangeUserName() function?&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1307654" width="1" height="1"&gt;</description></item><item><title>Membership Provider: changing the username</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1283320</link><pubDate>Mon, 05 Nov 2007 04:12:53 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1283320</guid><dc:creator>Powered by Vision</dc:creator><description>&lt;p&gt;Membership Provider: changing the username&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1283320" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1281368</link><pubDate>Sun, 04 Nov 2007 02:54:26 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1281368</guid><dc:creator>Doug Taylor</dc:creator><description>&lt;p&gt;Like the addition, but I'm guessing you do this because your front end has the user log in with their e-mail address and password: making the e-mail behave as if it was the username. &amp;nbsp;For those of us still using the &amp;quot;out of the box&amp;quot; behavior, this isn't the case, so you you wouldn't necessarily want to overwrite the e-mail address with a username change.&lt;/p&gt;
&lt;p&gt;However I wonder if that's a better way to go... probably easier for users to remember an e-mail address over a username, especially if they visit the site sporadically.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1281368" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1277581</link><pubDate>Fri, 02 Nov 2007 03:43:21 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1277581</guid><dc:creator>FM</dc:creator><description>&lt;p&gt;Works like a charm Doug! &amp;nbsp;Thanks. &amp;nbsp;I added the following to your stored procedure cause I'm anal and I want everything to be consistent:&lt;/p&gt;
&lt;p&gt;-- Change the e-mail address&lt;/p&gt;
&lt;p&gt;UPDATE dbo.aspnet_Membership&lt;/p&gt;
&lt;p&gt;SET Email = @NewUserName, LoweredEmail = LOWER(@NewUserName)&lt;/p&gt;
&lt;p&gt;WHERE ApplicationId = @ApplicationId AND UserId = @UserId&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1277581" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1277560</link><pubDate>Fri, 02 Nov 2007 03:23:17 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1277560</guid><dc:creator>Doug Taylor</dc:creator><description>&lt;p&gt;Hey folks, looks like I spoke too soon... a problem with my class above is Membership.GetUser() is designed to return a MembershipUser object. &amp;nbsp;So when I try to do this:&lt;/p&gt;
&lt;p&gt;Dim myUser As cMembershipUser&lt;/p&gt;
&lt;p&gt;myUser = Membership.GetUser(Me.OriginalUserName)&lt;/p&gt;
&lt;p&gt;it fails because myUser is the wrong type, and even when I try to cast the return result it doesn't work. &amp;nbsp;Anyone know how to use inheretance, but still let your modified class be used in this way? &amp;nbsp;In the meantime as a workaround I created a static utility class with a method that lets me update the username interfacing with the stored procedure above. &amp;nbsp;I've pasted it below, and you'd use it like this:&lt;/p&gt;
&lt;p&gt;utils.ChangeUserName(&amp;quot;oldUserName&amp;quot;, &amp;quot;newUserName&amp;quot;)&lt;/p&gt;
&lt;p&gt;----------------&lt;/p&gt;
&lt;p&gt;Imports Microsoft.VisualBasic&lt;/p&gt;
&lt;p&gt;Imports System.Data.SqlClient&lt;/p&gt;
&lt;p&gt;Public Class utils&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Public Shared Function ChangeUserName(ByVal oldUserName As String, ByVal newUserName As String) As Boolean&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim IsSuccsessful As Boolean = False&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If IsUserNameValid(NewUserName) Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim myConn As New SqlConnection(ConfigurationManager.ConnectionStrings(&amp;quot;pbv2005&amp;quot;).ToString)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim cmdChangeUserName As New SqlCommand()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;With cmdChangeUserName&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.CommandText = &amp;quot;dbo.aspnet_Membership_ChangeUserName&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.CommandType = Data.CommandType.StoredProcedure&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.Connection = myConn&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.Parameters.Add(&amp;quot;@ApplicationName&amp;quot;, Data.SqlDbType.NVarChar)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.Parameters.Add(&amp;quot;@OldUserName&amp;quot;, Data.SqlDbType.NVarChar)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.Parameters.Add(&amp;quot;@NewUserName&amp;quot;, Data.SqlDbType.NVarChar)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End With&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmdChangeUserName.Parameters(&amp;quot;@ApplicationName&amp;quot;).Value = ConfigurationManager.AppSettings(&amp;quot;AppKey&amp;quot;).ToString&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmdChangeUserName.Parameters(&amp;quot;@OldUserName&amp;quot;).Value = oldUserName&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmdChangeUserName.Parameters(&amp;quot;@NewUserName&amp;quot;).Value = newUserName&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myConn.Open()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmdChangeUserName.ExecuteNonQuery()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myConn.Close()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IsSuccsessful = True&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Catch ex As Exception&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IsSuccsessful = False&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End Try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IsSuccsessful = False&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return IsSuccsessful&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End Function&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Private Shared Function IsUserNameValid(ByVal username As String) As Boolean&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Add whatever username requirement validation you want here, doesn't&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' the membership provider have some build in functionality for this?&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If username.Length &amp;gt; 4 Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return True&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return False&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End Function&lt;/p&gt;
&lt;p&gt;End Class&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1277560" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1274670</link><pubDate>Tue, 30 Oct 2007 19:40:35 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1274670</guid><dc:creator>Doug Taylor</dc:creator><description>&lt;p&gt;Here's a class that interfaces with the stored procedure I just mentioned. &amp;nbsp;It inherits from System.Web.Security.MembershipUser, and I use it like this (VB.NET):&lt;/p&gt;
&lt;p&gt;Dim myUser As cMembershipUser&lt;/p&gt;
&lt;p&gt;myUser = Membership.GetUser(Me.OriginalUserName)&lt;/p&gt;
&lt;p&gt;myUser.ChangeUserName(&amp;quot;NewUserNameHere&amp;quot;)&lt;/p&gt;
&lt;p&gt;--------------------------&lt;/p&gt;
&lt;p&gt;Imports Microsoft.VisualBasic&lt;/p&gt;
&lt;p&gt;Imports System.Data.SqlClient&lt;/p&gt;
&lt;p&gt;Public Class cMembershipUser&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Inherits System.Web.Security.MembershipUser&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Public Function ChangeUserName(ByVal NewUserName As String) As Boolean&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim IsSuccsessful As Boolean = False&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If IsUserNameValid(NewUserName) Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim myConn As New SqlConnection(ConfigurationManager.ConnectionStrings(&amp;quot;pbv2005&amp;quot;).ToString)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim cmdChangeUserName As New SqlCommand()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;With cmdChangeUserName&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.CommandText = &amp;quot;dbo.aspnet_Membership_ChangeUserName&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.CommandType = Data.CommandType.StoredProcedure&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.Connection = myConn&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.Parameters.Add(&amp;quot;@ApplicationName&amp;quot;, Data.SqlDbType.NVarChar)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.Parameters.Add(&amp;quot;@OldUserName&amp;quot;, Data.SqlDbType.NVarChar)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.Parameters.Add(&amp;quot;@NewUserName&amp;quot;, Data.SqlDbType.NVarChar)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End With&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmdChangeUserName.Parameters(&amp;quot;@ApplicationName&amp;quot;).Value = ConfigurationManager.AppSettings(&amp;quot;AppKey&amp;quot;).ToString&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmdChangeUserName.Parameters(&amp;quot;@OldUserName&amp;quot;).Value = Me.UserName&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmdChangeUserName.Parameters(&amp;quot;@NewUserName&amp;quot;).Value = NewUserName&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myConn.Open()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmdChangeUserName.ExecuteNonQuery()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myConn.Close()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IsSuccsessful = True&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Catch ex As Exception&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IsSuccsessful = False&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End Try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IsSuccsessful = False&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return IsSuccsessful&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End Function&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Private Function IsUserNameValid(ByVal username As String) As Boolean&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Add whatever username requirement validation you want here, doesn't&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' the membership provider have some build in functionality for this?&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If username.Length &amp;gt; 4 Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return True&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return False&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End Function&lt;/p&gt;
&lt;p&gt;End Class&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1274670" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1274660</link><pubDate>Tue, 30 Oct 2007 18:29:37 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1274660</guid><dc:creator>Doug Taylor</dc:creator><description>&lt;p&gt;After reading the discussion above I created the following stored procedure that seems to do the trick. &amp;nbsp;Sorry if it got word-wrapped, but hopefully you get the idea. &amp;nbsp;I'm surprised that Microsoft would have the foresight to distinguish between UserId and UserName, but not build in the ability to change the username. &amp;nbsp;Why else would you have a seperate UserId value if not to let UserName change?&lt;/p&gt;
&lt;p&gt;Working on something now that'll allow this to be called in code along the lines of:&lt;/p&gt;
&lt;p&gt;Membership.ChangeUserName(&amp;quot;OldName&amp;quot;, &amp;quot;NewName&amp;quot;)&lt;/p&gt;
&lt;p&gt;Hope it helps!&lt;/p&gt;
&lt;p&gt;------------&lt;/p&gt;
&lt;p&gt;CREATE PROCEDURE dbo.aspnet_Membership_ChangeUserName&lt;/p&gt;
&lt;p&gt;	@ApplicationName NVARCHAR(256),&lt;/p&gt;
&lt;p&gt;	@OldUserName NVARCHAR(256),&lt;/p&gt;
&lt;p&gt;	@NewUserName NVARCHAR(256)&lt;/p&gt;
&lt;p&gt;AS&lt;/p&gt;
&lt;p&gt;BEGIN&lt;/p&gt;
&lt;p&gt;	DECLARE @UserId AS UNIQUEIDENTIFIER&lt;/p&gt;
&lt;p&gt;	DECLARE @ApplicationId AS UNIQUEIDENTIFIER&lt;/p&gt;
&lt;p&gt;	-- Lookup the ApplicationId&lt;/p&gt;
&lt;p&gt;	SELECT @ApplicationId = ApplicationId&lt;/p&gt;
&lt;p&gt;	FROM dbo.aspnet_Applications&lt;/p&gt;
&lt;p&gt;	WHERE LoweredApplicationName = LOWER(@ApplicationName)&lt;/p&gt;
&lt;p&gt;	-- Lookup the UserId&lt;/p&gt;
&lt;p&gt;	SELECT @UserId = UserId&lt;/p&gt;
&lt;p&gt;	FROM aspnet_Users&lt;/p&gt;
&lt;p&gt;	WHERE ApplicationId = @ApplicationId AND LoweredUserName = LOWER(@OldUserName)&lt;/p&gt;
&lt;p&gt;	-- Change the username&lt;/p&gt;
&lt;p&gt;	UPDATE dbo.aspnet_Users&lt;/p&gt;
&lt;p&gt;	SET UserName = @NewUserName, LoweredUserName = LOWER(@NewUserName)&lt;/p&gt;
&lt;p&gt;	WHERE ApplicationId = @ApplicationId AND UserId = @UserId&lt;/p&gt;
&lt;p&gt;END&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1274660" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1252385</link><pubDate>Sat, 20 Oct 2007 10:28:48 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1252385</guid><dc:creator>boby</dc:creator><description>&lt;p&gt;i usee the query in this controlchange password&lt;/p&gt;
&lt;p&gt;&amp;quot;select password into register where&lt;/p&gt;
&lt;p&gt;email='&amp;quot;+changepassword1.Username+&amp;quot;'&amp;quot;&lt;/p&gt;
&lt;p&gt;then&lt;/p&gt;
&lt;p&gt;it give massege for falier&lt;/p&gt;
&lt;p&gt; if i use username field in username text the give success massege &lt;/p&gt;
&lt;p&gt;but i want to control on email basies&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1252385" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1224590</link><pubDate>Tue, 02 Oct 2007 07:37:38 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1224590</guid><dc:creator>Ben Erwood</dc:creator><description>&lt;p&gt;Daniel,&lt;/p&gt;
&lt;p&gt;I've used the approached you describe and it has worked just fine for me.&lt;/p&gt;
&lt;p&gt;Cheers, Ben&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1224590" width="1" height="1"&gt;</description></item><item><title>re: How to change user name in ASP.NET 2.0 Membership Provider</title><link>http://msmvps.com/blogs/omar/archive/2006/08/18/how-to-change-user-name-in-asp-net-2-0-membership-provider.aspx#1214834</link><pubDate>Tue, 25 Sep 2007 13:59:55 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1214834</guid><dc:creator>Jon Swain</dc:creator><description>&lt;p&gt;I ended up just going straight to the database level and changing each username within the database. &amp;nbsp;You can easily do this in the aspnet_users table.&lt;/p&gt;
&lt;p&gt;See:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://jonswain.wordpress.com/2007/09/24/renamingchanging-username-in-aspnet/"&gt;jonswain.wordpress.com/.../renamingchanging-username-in-aspnet&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1214834" width="1" height="1"&gt;</description></item></channel></rss>