How to update / delete ASPNETDB.MDF 'vw_aspnet_MembershipUsers'?
How to update / delete ASPNETDB.MDF 'vw_aspnet_MembershipUsers'
To enable / disable the site registers users or delete users ///开发者_StackOverflow
using asp.net
for Deleting you can use:
using System.Web.Security;
Membership.DeleteUser(TextBox_username.Text);
and for updating a username you can use above cod .first delete it and then make a new one.
Note that you can't explicitly delete rows from a view (vw_aspnet_MembershipUsers), but this view is most likely based on the AspNetUsers table.
Connect to the MDF file (which is probably in your App_Data folder) in Visual Studio: https://stackoverflow.com/a/173221/188926
Right-click the database in Server Explorer > New Query
type:
delete from AspNetUsers
and hit run (you may need to delete from AspNetRoles first)
精彩评论