FTP Database to webhost server - sql

I have written an asp.net mvc application that is connected to a Microsoft SQL Server Management Studio database and I want to deploy the application to the webhosting server now. I have managed to get the published code onto the server easily. However, I want to ftp the database I created in Microsoft SQL Server Management Studio to the server. Where are these created databases saved and is it possible to ftp the database to the server. The other issue is the web hosting server is using MS SQL Server Express is that a problem?

Normally shared hosts expect you to place the database in the App_Data folder and use it directly from there.
Here is a page to explain connecting to the database
http://msdn.microsoft.com/en-us/library/ms247257.aspx
To find the database on your system open sql management studio right click the Database and click Properties on the Properties windows click on the Files section to show all associated files with your database.
I would recommend checking your providers documentaion though they might have specific requirments for database deployments

Related

How to view data on the Azure SQL database

I created a default ASP.NET web form web site using Visual Studio. By default it contains a .mdf database file, Registration page, Login page and some other pages. Then I host this web application on Azure as a web app.
After that I did several registrations for the web site and I need to see the data (data which i used on registration) on the hosted application.
Is there any way to connect to the database file in Azure? In Azure, I did not set up a connection string. I just publish the app and it manages the database connection itself.
There is nothing inside the "Database" section
It seems that you do not publish your asp.net to Azure with Sql Database correctly. So, you could refer to this article to check if you have deploy database correctly.
As you have published, you could go to the database on Azure portal and choose query editor(preview). Click Login and enter the username and password you have set in Azure Sql server.
Also, you could open Microsoft SQL Server Management Studio to get your database. And you also need to login into the Sql Server as above.
After logining into the sql database, you will see all the data you have insert.
BTY, make sure you have synced the data in local database to Azure Sql Database. For more details, you could refer to this article.

VB.NET Creating a local database in VS2013 or in SQL Server Management Studio

I am about to begin a personal project to build my skills in the .net environment. I am familiar with SQL Server Management Studio and how to create a database in it but I discovered how to make a local database in Visual Studio as well. My program is only going to require local database access as it will be used for individual inventory systems rather than connected ones. Am I ok to use the onboard tools in visual studio and create a local databasse or should I be using the SQL Server Management Studio?
When you use the Local Database item template in VS, it creates a SQL Server CE data file (SDF) and adds it to your project. When you use the Service-based Database item templete, it creates a SQL Server (Express) data file (MDF) and adds it to your project.
The advantage of using the VS tools is that the data file becomes part of your project and can therefore be easily deployed with the compiled application. As such, the database is basically part of the application.
If you choose SQL Server CE then you don't need a server installed on the user's local machine. They can install SQL Server CE or you can install it with your app if you want, but you also have the option of simply deploying a DLL with your app and it will work.
If you choose SQL Server Express then the user actually needs a SQL Server instance installed on their machine. To be honest, I'm not 100% sure whether that instance must be SQL Server Express or it can be a full SQL Server instance too. It would usually be SQL Server Express though, which you can install and even download automatically when you install your app, depending on the deployment method you choose.
If you use the VS tools to create an MDF data file then your connection string will contain the Data Source and AttachDbFilename attributes. The Data Source will generally be ".\SQLExpress", i.e. an instance named "SQLExpress" on the local machine. That instance name is not required, although it is the default for SQL Server Express, but it must be on the local machine. The MDF file gets attached at run time and detached again when you're app is done with it. It will also usually be attached to a user instance, which means that other users can't see it, even when it's attached. Note that, in later versions, the LocalDB feature of SQL Server may also be utilised.
If you create your database in Management Studio then it's not actually part of your app. It will be permanently attached to the SQL Server instance so, everyone will be able to see it and open it, assuming permissions allow. Creating the database during deployment will be an extra step in that case. You might create a backup and restore that during deployment or generate SQL scripts that get run. In this case, your connection string will contain the Initial Catalog attribute to specify the name of database to connect to, as well as the Data Source attribute. This option is required if you want multiple clients to be able to connect to the database.
In short, if you are only going to be accessing a database from the local instance of the one application then creating a database in VS is OK and probably a good idea. Whether you choose SQL Server CE or SQL Server Express may well depend on what level of functionality you need.

How to deploy an MVC 4 application to a Windows Web Server based dedicated hosting?

I want to deploy an MVC 4 web application to a Windows Web Server 2008 based dedicated hosting. I am using SQL Server 2008 R2 Express as my back-end database. What steps will I need to take regarding the following:
Installing SQL Server 2008 R2 Express on the web server and deploying my database.
Managing SQL Express database remotely using SSMS.
Configuring database path in my EF5 generated model
Deploying my application
Managing changes to my application.
Can someone provide me a detailed answer/some good links?
Installing SQL Server 2008 R2 Express on the web server and deploying my database.
This depends on your provider. Most providers, if not all, allow you to install your own licensed SQL Server. If you will be using an Express edition then it is, and should be, 100% allowable by your provider. The only step you need here is to go to download page of SQL Server 2008 R2 and download the appropriate file you need. The files you need on that page are the ones with "ADV" in its name. Choose x64 if you will install a 64-bit OS or choose x86 if you will install a 32-bit OS.
Managing SQL Express database remotely using SSMS.
This depends on the firewall set by your provider. But basically this is how you will allow remote access to your SQL Server:
For Windows 2008 R2
Login to your dedicated server using Remote Desktop. If you don't know how to do this, it's best that you consult with your provider.
Go to Start > All Programs > Microsoft SQL Server 2008 R2 > Configuration Tools -> SQL Server Configuration Manager
On the window that open in step #2, expand SQL Server Configuration Manager (Local) -> SQL Server Network Configuration -> Protocols for SQLExpress
On the right pane, right-click TCP/IP and select Properties.
Select the IP Addresses tab and then scroll to the IP All section.
Set/change the TCP Port value to/from 1433 to 14333 (or any other port) and then click OK.
Right-click TCP/IP again and Enable it
Restart your SQL Server by going to Start -> All Programs -> Administrative Tools -> Services -> SQL Server (SQLEXPRESS) -> Restart. The Restart is on the left pane.
Configuring database path in my EF5 generated model
Unfortunately, I cannot answer this one as I believe you are using the EF designer in creating your model. I never worked with EF that way, but only by code-first. I have to skip this part and let you Google this.
Deploying my application
There is already a good documentation written here so I will not dupliate it here. Basically what you need to do is enable FTP on your dedicated server. Then once that is setup you can go on with bin-deploying your application.
Managing changes to my application.
I assume what you are asking here is that if you have changes to your application, how would you re-deploy it. A bin-deployment will not hurt. Deploying only the files in which you have changes is a good approach. Knowing which files changed can vary depending on the tools you use. In addition, if you don't have any fancy setup that will tell your users you are deploying changes to your site, you might want to take a look at this post. It tells you to put a App_Offline.htm file in your root web directory. That should still work with MVC, after all MVC is still ASP.Net.

SHAREPoint Data transfer

I had created a multi site SharePoint application using MOSS 2007. My hard drive went south. However, I was able to make an Acronis Image of the drive. I have all the SQL 2005 Server files. I have rebuilt the SharePoint Environment Using Win2k3 Enterprise Server, SQL 2005 Server, WSS 3.0 SP2, and MOSS 2007. I don't want to rebuild the entire site over again.
The original site was in a laptop environment. The new infrastructure is running on a Dell 2970 server.
I was able to restore the SQL Server files from the Acronis image to a USB drive and a DVD. Is there a way to salvage the SQL databases/data to the new server so Sharepoint can access them?
Try this:
Create a new web application on your newly built SharePoint Server.
From Central Admin site, select content database. Select and remove the content database of this new site created in step 1.
Frpm SQL Server Management Strudio create new database with same name as that of your 'salvaged' content database.
Then restore database from your 'salvaged' content database file. Choose 'overwrite' from options..
Back to your Central Admin site, select 'Add Content database' to the new web application you created in step 1 and specify the name of the restored database.
Repeat the process for each web application.

Restore a SQL Server database from single instance to cluster

I need to transfer a database from a SQL Server instance test server to a production environment that is clustered. But SQL Server doesn't allow you to use backup/restore to do it from single instance to cluster. I'm talking about a Microsoft CRM complex database here.
Your help is greatly appreciated.
Have a look at the Microsoft SQL Server Database Publishing Wizard:
SQL Server Database Publishing Wizard
enables the deployment of SQL Server
databases into a hosted environment on
either a SQL Server 2000 or 2005
server. It generates a single SQL
script file which can be used to
recreate a database (both schema and
data) in a shared hosting environment
where the only connectivity to a
server is through a web-based control
panel with a script execution window.
If supported by the hosting service
provider, the Database Publishing
Wizard can also directly upload
databases to servers located at the
shared hosting provider.
Optionally, SQL Server Database
Publishing Wizard can integrate
directly into Visual Studio 2005
and/or Visual Web Developer 2005
allowing easy publishing of databases
from within the development
environment.
You don't have to use the server-side piece; the client-side 'create a script' piece is generally enough.