How to use aspnetdb database with an asp.net website

浪尽此生 提交于 2019-12-10 10:14:11

问题


I have created a website using asp.net 3.5. And now I have added member support to it using Membership API and aspnetdb database. And I have done all testing on my local machine. Now, what issue needs to be considered with respect to aspnetdb while uploading this site to the server. ie; how this database will be available on the server side ? Note : This is my first ever website.


回答1:


I was just looking for an answer to this myself.

I've found the following that might help you:
http://www.studiocoast.com.au/knowledgebase/article-6-aspnet-using-sql-server-instead-of-aspnetdbmdf.aspx

"When developing applications in ASP.NET 2.0, the default option for roles and users is to use a local SQL database in the App_Data directory.

This works fine locally, but will bring up an error when uploaded to a production server. To fix this the ASP.NET membership information needs to be stored in a dedicated SQL Server database."

"ASP.NET includes a program called Aspnet_regsql.exe which you can run locally to configure your database. More information on the program can be found here:

http://msdn2.microsoft.com/en-us/library/ms229862.aspx"




回答2:


Look in your C:\Windows\Microsoft.NET\Framework\v2.0.50727\ folder for the file InstallMembership.sql.

Thats the SQL script to create the database you need.



来源:https://stackoverflow.com/questions/1611937/how-to-use-aspnetdb-database-with-an-asp-net-website

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!