从 sql Express 数据库创建 sql 数据库
我正在开发 ASP.NET 会员网站。我自动创建了会员资格提供程序,现在它存储在解决方案中的 sql express 数据库中。我想将所有表移动到 sql 数据库而不是 sql express。昨晚我将 sql express 数据库附加到 sql server management studio,我能够看到所有对象。然后,我在 Visual Studio 中运行我的解决方案,但出现错误:SQL Express 数据库登录失败,并且解决方案未运行。 我有两个问题。 1. 为什么会出现这种情况? 2.如果我在sql server中使用相同的对象创建相同的数据库,然后指向sql server数据库而不是sqlexpress数据库,我的membershop提供程序是否会出现问题? 提前致谢。
I am working on asp.net membership website. I created the membership provider automatically, and now its stored in sql express database within the solution. I want to move all the tables to sql database instead of sql express. Last night I attached the sql express database to the sql server management studio, and I was able to see all the objects. Then, I run my solution in visual studio, and I got error: LOGIN FAILED for the sql express database, and the solution wasn't running.
I have two questions.
1. Why is that happening?
2. If I create the same database in sql server with the same objects, and then point to the sql server database instead of sql express database, will I have problems with the membershop provider?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您已将数据库从一台主机(运行 SQL Server Express)移动到另一台主机(运行非 Express SKU)。这是正确的吗?
确保您的成员资格连接字符串指向成员资格(非 Express SQL Server)的新位置。确保在新的 SQL Server 实例中按预期正确设置登录名和用户。
It sounds like you've moved a database from one host (running SQL Server Express) to another host (running a non-Express SKU). Is this correct?
Ensure that your membership connection string is pointing to the new location of the membership (the non-Express SQL Server). Ensure the logins and users are setup properly in the new SQL Server instance, as expected.
将数据库附加到新服务器不会自动创建必要的登录名。
从 SSMS 中对数据库运行
exec sp_change_users_login 'Report'
。如果返回结果集中有任何内容,您需要运行 exec sp_change_users_login 'Auto_Fix', ''
其中是第一个结果集中的用户名。
Attaching a database to a new server does not automatically create the necessary logins.
run
exec sp_change_users_login 'Report'
from within SSMS on your database.If it comes back with anything in the result set, you'll need to run
exec sp_change_users_login 'Auto_Fix', '<username>'
where is the username from the first result set.