简体   繁体   English

发布ASP.NET站点 - 没有登录数据库?

[英]Publishing ASP.NET site - No login database?

I have a very simple app on my local machine that uses the ASP.NET membership provider. 我的本地计算机上有一个非常简单的应用程序,它使用ASP.NET成员资格提供程序。 This works fine on my local machine. 这在我的本地计算机上工作正常。

I have published the app to our web server, and I need to know the specifics of setting up the application for asp.net membership to work. 我已经将该应用程序发布到我们的Web服务器,并且我需要了解设置该应用程序以使asp.net成员身份能够正常工作的具体细节。

I have a basic understanding that it uses an MDF file and somehow connects to a SQL database (SQLEXPRESS I assume on my local machine) which holds the user/role information. 我基本了解它使用MDF文件并以某种方式连接到SQL数据库(我在本地计算机上假设的SQLEXPRESS),它保存用户/角色信息。

I keep getting an error that it cannot connect to a SQL database when running the published application on the web server. 在Web服务器上运行已发布的应用程序时,我不断收到错误消息,它无法连接到SQL数据库。

I wish to use a SQL server on a different machine (SQL69) than my web server (WEB69) I have created a new connection string, but how do I tell ASP.NET to use it instead of the "LocalSqlServer" connection string that is created by default? 我希望在与Web服务器(WEB69)不同的计算机(SQL69)上使用SQL Server,但我已经创建了新的连接字符串,但是如何告诉ASP.NET使用它而不是使用“ LocalSqlServer”连接字符串呢?默认创建? Can someone explain what is required to me? 有人可以向我解释什么吗?

Thanks for any help you can offer. 谢谢你的尽心帮助。

Use the ASP.NET SQL Server Registration Tool without any parameters to set up the SQL Server membership on your local machine. 使用不带任何参数的ASP.NET SQL Server注册工具在本地计算机上设置SQL Server成员身份。 This will also update your config file: 这也会更新您的配置文件:

http://msdn.microsoft.com/en-us/library/ms229862%28VS.80%29.aspx http://msdn.microsoft.com/en-us/library/ms229862%28VS.80%29.aspx

You need to set up SQL Server DB membership on your local machine first. 您需要首先在本地计算机上设置SQL Server数据库成员身份。 After you have this working, you can simply script the entire DB for your production environment. 完成此操作后,您只需为生产环境编写整个数据库脚本。 For this, you can use the Database Publishing Wizard in VS. 为此,您可以使用VS中的数据库发布向导。

You can view a sample config file here: 您可以在此处查看示例配置文件:

http://www.codersbarn.com/post/2008/02/24/ASPNET-20-Guest-Book-Admin-Part-II.aspx http://www.codersbarn.com/post/2008/02/24/ASPNET-20-Guest-Book-Admin-Part-II.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM