在我的项目中,我当前有两个数据库,一个名为 ASPNETDB.MDF,另一个名为 School.sdf。 ASPNETDB.MDF 是由 .net 默认成员资格提供程序创建的,我使用 Entity Framework 创建了第二个。当我启动这个项目时,所有这些信息都需要包含在同一个项目中。我如何使应用程序正常运行,就好像只有一个数据库而不是两个数据库一样 - 我如何合并所有这些数据,或者 - 至少 - 构建一个准备好播种所有必要信息的空白数据库、我的学校背景和默认成员(member)提供商信息。
有人可以帮我解决这个问题吗?
最佳答案
您可以点击 MS 的此链接:http://www.asp.net/web-forms/tutorials/security/membership/creating-the-membership-schema-in-sql-server-cs
它包括执行工具 aspnet_regsql.exe,位于 %WINDIR%\Microsoft.Net\Framework\vFRAMEWORK_VERSION_NUMBER\
The aspnet_regsql.exe tool is used to add or remove ASP.NET application services to a specified SQL Server database. The ASP.NET application services encompass the schemas for the SqlMembershipProvider and SqlRoleProvider, along with the schemas for the SQL-based providers for other ASP.NET 2.0 frameworks.
这里讨论的是 2.0,但对于较新版本的工作原理相同。
关于asp.net-mvc - 将两个两个数据库上下文合并为一个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10973759/