I have worked quite a bit in the older fashion, generating a database project and making scripts and all that. However I am starting a new project using code first, for the first time. I have the database setup locally and everything seems to run fine, I then added a database to my hosting plan but I cant figure out how to "publish" the database to your servers. First thing I attempted to do was use the "Publish Data-tier Application" feature in visual studio (2012 btw). Now this peice is a bit strange, after entering the target database connection and successfully "testing" the connection by clicking the Test Connection button. The ui actually locks up, apparently trying to connect. Once I got an error message saying that my login failed (even after testing connection), but every other try has simply locked up the dialog box. Next I tried just connecting to the database with the Schema Compare tool, this seemed to work fine. I was able to actually sync all the tables in the database with the server. However upon successfully publishing the site to the web server and trying to load the site I am presented with this error message, "Model compatibility cannot be checked because the database does not contain model metadata. Model compatibility can only be checked for databases created using Code First or Code First Migrations." This, I cannot seem to get around despite trying several suggestions I have found on other sites. My question for you all is, what is the best support method for doing this? Like I said I am using entity framework and the code first method, so I dont really have a database project, I do however actually have a database in LocalDB that was created by EF using the initializer class that I created. Like I said everything here works fine, I just need to get the thing deployed to your servers. Please help. Thanks.
So I also created an actual database project from the "LocalDB" instance and try to run the Publish from there. This actually ran successfully, and created the database structure and everything. But I run into the same error as before when I try to do anything from the site itself.
If you ordered the SQL addon to your DiscountASP hosting plan, then you will have access to the SQL Tool. Inside the DiscountASP control panel go to MS SQL Manager. You should see three tabs: "Database Information", "Login Manager", "SQL Tool Suite". If you click on the SQL Tool Sute tab you will have the option in the control panel to restore the database to the SQL server. But first you will first need to backup your local database on your local computer. Your computer will generate you a file with a .bak extension. Upload that file with the .bak extension to your root using FTP. Then you can use the SQL Tool Suite in your control panel to initiate a restore to the SQL server. This tool will take the .bak file you uploaded to the web server and try to restore it to the SQL server.
I have a similar question, only using SQL Server 2012 Express. My site is up and running but I would prefer doing database development on my local site, then creating a backup and uploading the backup to my site. Are there problems I should be aware of here.
You shouldn't have any problem using the SQL Attach tool in Control Panel to attach a SQL Express database to a SQL database.