0

How to update / delete ASPNETDB.MDF 'vw_aspnet_MembershipUsers'

To enable / disable the site registers users or delete users ///

using asp.net

D Infosystems
  • 514
  • 1
  • 12
  • 44
  • it's not clear what you are asking. Do you want to know how to update the view or how to add the ability to enable/disable/delete users from a site? – Ken Henderson Nov 29 '10 at 03:54
  • I want to know how to Update / delete the table records in ASPNETDB.MDF in single update / delete query ? – D Infosystems Nov 29 '10 at 04:14

2 Answers2

0

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.

0

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.

  1. Connect to the MDF file (which is probably in your App_Data folder) in Visual Studio: https://stackoverflow.com/a/173221/188926

  2. Right-click the database in Server Explorer > New Query

  3. type: delete from AspNetUsers and hit run (you may need to delete from AspNetRoles first)

Community
  • 1
  • 1
Dunc
  • 18,404
  • 6
  • 86
  • 103