简体   繁体   中英

Publishing ASP.NET site - No login database?

I have a very simple app on my local machine that uses the ASP.NET membership provider. 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.

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.

I keep getting an error that it cannot connect to a SQL database when running the published application on the web server.

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? 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. This will also update your config file:

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. 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.

You can view a sample config file here:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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