删除角色并恢复表中的角色
因为一个错误。我使用了错误的命令。我想从表 aspnet_UsersInRoles 中删除用户角色。 我猜该命令可能是
Roles.RemoveUserFromRole(userName, origin_role);
但是我错误地使用了错误的命令。
Roles.DeleteRole(origin_role,false);
最初该表有 4 个角色。现在表中的RoleId只有两个,
61572264-4935-461d-9d8c-71f147f28c34
c09f25e6-fd6a-447b-8e0d-eba0cfc94e40
如何找到并恢复它们? 非常非常感谢。
for a mistake. I used a wrong command. I wanted to remove an user' role from the table aspnet_UsersInRoles.
I guess that the command might be
Roles.RemoveUserFromRole(userName, origin_role);
However I used a wrong command mistakenly.
Roles.DeleteRole(origin_role,false);
Originally the table has 4 roles. Now the RoleId in the table only has two,
61572264-4935-461d-9d8c-71f147f28c34
c09f25e6-fd6a-447b-8e0d-eba0cfc94e40
How can I find and recovery them?
Many many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不想这么说,但你已经被浇灭了。默认的 ASP.Net 提供程序不包含任何类型的审核或软删除。如果您有数据库备份,您可以从中浏览/恢复。
Hate to say it, but you're hosed. The default ASP.Net providers don't include any sort of auditing or soft-delete. If you have a database backup, you can explore/restore from that.
您可以在下面找到您调用的函数的源代码。
它调用 dbo.aspnet_Roles_DeleteRole 存储过程。
我目前无法访问 ASP.NET 会员数据库,否则我会为您检查。
您可能想检查存储过程的作用,但正如 ssyladin 提到的,我怀疑您是否能够恢复任何内容(因为您将 throwOnPopulatedRole 参数发送为 false)。
Below you find the source code for the function you called.
It calls the dbo.aspnet_Roles_DeleteRole stored procedure.
I don't have access to an asp.net membership database at the moment, otherwise I would check for you.
You might want to check what the stored procedure does, but as ssyladin mentioned I doubt you will be able to recover anything (since you sent the throwOnPopulatedRole argument to false).