简体   繁体   English

如何在Azure网站上放置数据库

[英]How to put database on azure website

I recently finished my asp website, bought the domain and azure hosting. 我最近完成了我的asp网站,购买了域名和Azure托管。 Unfortunately, when I try to do anything that accesses the database I just get stuck on a loading screen. 不幸的是,当我尝试执行任何访问数据库的操作时,我只会停留在加载屏幕上。 I just used the default asp razor mvc 5 project I think for the database along with a couple of custom tables. 我只是使用了我认为用于数据库的默认asp razor mvc 5项目以及几个自定义表。

So here is how I would do it since you have an existing database. 既然您有一个现有的数据库,那么这就是我要怎么做。 I would follow azures website, and set up a SQL database. 我将关注azures网站,并建立一个SQL数据库。 I would then script out the database on you local machine, and log into your azure database using SQL Server Express. 然后,我将脚本编写出本地计算机上的数据库,然后使用SQL Server Express登录到您的Azure数据库。 Execute the script you generated from localDB. 执行您从localDB生成的脚本。 Then all of your data will be good to go. 这样一来,您所有的数据都将得到处理。 You will then need to take the connection string from azure, and put it in your applications config file. 然后,您需要从Azure中获取连接字符串,并将其放入应用程序配置文件中。 After modifying the connection string in your application you should redeploy, and verify everything is working the way you want. 修改应用程序中的连接字符串后,您应该重新部署,并验证一切是否按照您想要的方式工作。 You will be able to verify your data is there in SQL Server Express. 您将能够验证SQL Server Express中的数据。

Here is a link that may be of quite a bit of assistance to you. 这是一个可能对您有很大帮助的链接 It includes step by step instructions as well as screen shots. 它包括分步说明以及屏幕截图。

Another option is using this tool . 另一种选择是使用此工具 I have never used it, but I know a few people who have had great success with it. 我从未使用过它,但是我知道有一些人在它上取得了巨大的成功。

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

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