如何将带有 ASPNETDB.MDF 数据库的站点从开发服务器托管到生产服务器? [英] How to host site with ASPNETDB.MDF database from Development Server to Production Server?

查看:39
本文介绍了如何将带有 ASPNETDB.MDF 数据库的站点从开发服务器托管到生产服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 ASP.NET Personal Starter Kits 3.5 创建了我的网站.我只使用 Visual Studio 2008..使用其内置的 SQL Server (2005 Express) ...我在 App_Data 中的数据库是 ASPNETDB.MDF ...

I have created my site using ASP.NET Personal Starter Kits 3.5. I use Visual Studio 2008 only . .with its built-in SQL Server (2005 Express) ... my database in App_Data is ASPNETDB.MDF ...

我也在 ASPNETDB 中创建了一些表 ..

I have created some of my tables also ....in ASPNETDB ..

在我的本地 PC 上,该站点运行良好......

In my local PC the site was running fine ...

但是当我在生产服务器上发布我的网站时它不起作用并显示以下错误

But when I publish my site on production server it doesn't work and shows the following error

<!-- Web.Config Configuration File -->
<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

注意:通过修改应用程序配置标记的defaultRedirect"属性以指向自定义错误页面 URL,可以将您看到的当前错误页面替换为自定义错误页面.

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->
<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration> 

我的托管服务提供商连接字符串..

My hosting provider connection string ..

<add name="ConnectionString" connectionString="Data Source=69.16.253.19;Initial Catalog=usa_data;Persist Security Info=True;User Id=user;Password=pass" providerName="System.Data.SqlClient"/>

我的托管服务提供商给了我连接到 SQL Server 2005 的连接字符串,但它不起作用...

My hosting provider gave me the connection string to connect to the SQL Server 2005 but it doesn't work...

我不明白为什么我的站点在本地 PC 上使用生产 SQL Server 2005 运行良好,当我仅在本地 PC 的 App_Data 中包含 ASPNETDB.MDF 文件时..如果我从 App_Data 中删除文件 ASPNETDB.MDF我的本地电脑...网站停止工作...

I don't understand why my site was running fine using the production SQL Server 2005 in my local PC when I include ASPNETDB.MDF file in App_Data in my local pc only ..if I remove file ASPNETDB.MDF from App_Data of my local pc ... the site stops working ...

谁能告诉他们如何解决这个问题......!过去 3-4 天我很紧张

Can anybody tell em how to fix this ... !! I am very tensed since last 3-4 days

推荐答案

首先,APP_DATA 文件夹中的文件在生产中无法作为 DB 访问.您必须将整个数据库从 ASPNETDB.MDF 迁移到生产数据库服务器(由提供商提供).然后该网站将工作.另外,将配置更改为 : 以查看确切的错误!!

Firstly, the file in the APP_DATA folder is not accessible as a DB in production. You will have to migrate the whole Database from the ASPNETDB.MDF to the Production Database server (given by provider.) And then the site will work. Also, change the config to : to see the exact error!!

如果移植不起作用,请查看确切的错误并在此处发布.

If the porting doesn't work, see the exact error and post it here.

这篇关于如何将带有 ASPNETDB.MDF 数据库的站点从开发服务器托管到生产服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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