简体   繁体   English

ASP.NET MVS ASPNETDB-将SQL Server上传到托管站点

[英]asp.net mvs ASPNETDB - uploading sql server to hosting site

i have taken the default asp.net mvc template and customized to work for me. 我已经采用了默认的asp.net mvc模板并自定义为我工作。 I want to now upload this to my hosting provider. 我现在想将其上传到我的托管服务提供商。

how do i get the sql server database into my server. 如何将sql服务器数据库放入服务器。 Do i just upload the ASPNETDB.mdf file. 我是否只上传ASPNETDB.mdf文件。 What is this file actually? 这个文件实际上是什么? Does it represent the whole database. 它代表整个数据库吗?

Can i simply copy that file around to migrate my database. 我可以简单地复制该文件以迁移数据库。

The MDF file is the data file for your database. MDF文件是数据库的数据文件。 You would normally attach the database to the server instance, or take a backup of the database and restore it. 通常,您将数据库附加到服务器实例,或者对数据库进行备份并还原它。 However with your hosting provider this may not be possible, and you may need to create all the database objects again (via SQL scripts) and import any data that you require. 但是,对于您的托管服务提供商来说,这可能是不可能的,您可能需要再次创建所有数据库对象(通过SQL脚本)并导入所需的任何数据。

Attaching a database 附加数据库

Restoring a database 恢复数据库

Take a look at the "Database Publishing Wizard" from Microsoft. 查看Microsoft的“数据库发布向导”。 I hosted my site on GoDaddy and used it to get my database and data across. 我将网站托管在GoDaddy上,并用它来获取数据库和数据。

Of course I never used the default MDF file. 当然,我从来没有使用默认的MDF文件。 I actually created a primary database, imported the MDF file into it and added my own tables. 我实际上创建了一个主数据库,将MDF文件导入其中,并添加了自己的表。 And I used the DBW for that as well. 我也使用DBW。

You can find the Database Publishing Wizard here. 您可以在此处找到数据库发布向导

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

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