发布网站后出现aspnetdb.mdf问题. [英] aspnetdb.mdf problem after publish a website .

查看:71
本文介绍了发布网站后出现aspnetdb.mdf问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的人
-
终于,经过艰苦的努力,我设计并开发了一个网站,该网站在我的本地服务器上运行良好.

我有2个数据库,其中一个是主数据库,它是使用sql server 2005创建的,
另一个叫做[ aspnetdb.mdf ],它是在VS2008内部实现的
只是为了会员.

-
现在,当我使用FTP上传服务器上的网站后,该网站运行正常,但是当我浏览使用[ aspnetdb.mdf ]数据库的页面时,出现以下错误

"
尝试为文件D:\ ftp \文件夹1 \域名\ www \ App_Data \ aspnetdb.mdf附加自动命名的数据库失败.存在具有相同名称的数据库,或者无法打开指定的文件,或者该数据库位于UNC共享上.
"


我的web.config仅包含第一个数据库的连接字符串
-
我如何解决这个问题.
我尝试在Google上搜索此主题,但仍无济于事,请帮助我

感谢

Dears
-
finally after hard work , i designed and developed a website and it is working fine on my local server .

i have 2 databases ,one of them is the main database which i create it with sql server 2005 ,
the other one called [ aspnetdb.mdf ] which was implemented internally with VS2008
and it just for membership .

-
Now after i upload a website on a server using FTP , the website working fine but when i browse a page that using [aspnetdb.mdf] data base , the below Error appeared

"
An attempt to attach an auto-named database for file D:\ftp\folder 1 \Domain name \www\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
"


my web.config contain the connection string of the first DB only
-
how i solve this problem .
i try to google this topic but i reach nothing , kindly help me

thanks

推荐答案

请勿在托管服务器上使用aspnetdb.mdf.您可以使用aspnet_regsql命令行实用程序在主数据库中生成成员资格表.

http://www.shiningstar.net/ASPNet_Articles/SqlMembershipProvider.aspx [
Do not use the aspnetdb.mdf on the hosting server. You can generate the Membership tables inside your main database using the aspnet_regsql command line utility.

http://www.shiningstar.net/ASPNet_Articles/SqlMembershipProvider.aspx[^]


ASPNETDB.mdf生产服务器上的成员数据库.

您应该配置生产数据库以处理成员资格数据.在Visual Studio命令提示符下运行aspnet_regsql命令并配置所需的数据库.

其次,(如果您仍然只想使用它)默认情况下,当我们在开发机器上访问ASPNETDB.mdf时,正在使用Windows身份验证来访问它.当您将代码放在生产服务器上时,这将无法正常工作,因为必须禁用Windows身份验证,并且必须使用sqlserver authetication .您可以通过更改 web.config文件(特别是数据库的ConnectionString )来实现.
ASPNETDB.mdf should not be used as membership database on production server.

You should configure your production database to handle the membership data. run aspnet_regsql command on visual studio command prompt and configure the required database.

Secondly,(If you still want to use this only) by default the ASPNETDB.mdf is being accessed using the windows authentication when we access it on development machines. when you put your code on production server this will not work because windows authentication must be disables and sqlserver authetication must be used. you can do that by changing the web.config file, specifically the ConnectionString of the database.


这篇关于发布网站后出现aspnetdb.mdf问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆