创建我的第一个网站,该网站使用 ASP.NET (v4) 中提供的登录/会员系统。
到目前为止,一切都很好,使用 web.config 将其指向远程 SQL 服务器,并且它正在工作。
我最初没有为成员资格提供程序指定“applicationName”,因此当查看 SQL Server 中的表时,它会将名称显示为“/”。
我更新了 web.config 并添加了分配名称所需的 Membership 和 Provider 部分,分配了一个名称,然后运行 ASP.NET 配置向导来重新初始化用户数据库。
在 SQL Server 中,应用程序现在显示其名称和新的 GUID,并按预期工作。
我的问题是,是否有一种自动方法可以从各种 ASP.NET SQL 表中删除与“旧站点”关联的所有(现在不需要的)记录,还是我必须手动执行此操作?
如果我需要手动执行此操作,是否有人知道一组已制定的程序以确保从数据库中删除所有引用?
Creating my first site that uses the login/membership system provided in ASP.NET (v4).
So far all is good, used the web.config to point it at a remote SQL server, and it's working.
What I didn't do originally was specify an 'applicationName' for the membership provider, so when looking at the table(s) in the SQL server it shows the name as "/".
I updated the web.config and added the Membership and Provider sections needed to assign a name, assigned one, and ran the ASP.NET Configuration Wizard to re-initialize the user DB.
In the SQL server the application now shows its name and a new GUID, and works as expected.
My question is, is there an automated way to get rid of all the (now unneeded) records associated to the 'old site' from the various ASP.NET SQL table(s), or am I stuck doing it manually?
If I need to do this manually, is anyone aware of a laid out set of procedures to ensure all references are removed from the DB?
发布评论
评论(1)
我过去在我的开发机器上使用过这个脚本,没有出现任何问题。我不能说我真的和会员提供商一起去过城里,所以我只在用户和角色表中拥有数据,但我认为这个脚本应该整理所有内容。
当然,在运行之前请先进行备份,因为我还没有在它周围添加任何事务。
I have used this script on my development machine with no issues in the past. I can't say that I have ever really gone to town with the membership provider so I have only ever had data in the users and roles table but I think this script should tidy everything up.
Make a backup before you run it of course as I haven't added any transactions around it.