Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
The last step in deploying a website, either on your own dedicated server or through a hosting provider is to transfer your database structure and data if necessary. Visual Web Developer includes a tool that allows you to create a text file, a script that describes everything about your website including its tables, columns, data types and so on. And even includes all of the data that you have added to the database. When you use the Scripting tool you can choose to export just the database structure or the structure and the data.
To get to this tool go to the Database Explorer and go to the Data Connection that you are using to connect your database. Right-click on the Database Connection and select Publish to provider. The Database Publishing Wizard has two modes that you can use. Click Next on the introductory screen and select the database you want to work with, which in my case is mybookstore. In this screen you select either scripting to a file or publishing to a shared hosting provider. If you are working say with a hosting provider and you are renting SQL server space from that company, they'll give you information that allows you to connect to their database.
If you don't have that connection information you can instead save the structure and data information in the text file. I'm going to place the text file on my Desktop. I'll click the Browse button, I'll navigate to my Desktop and I'll name the file mybookstore. sql. I'll click Save to return to the Database Publishing Wizard and then I'll click Next. In this screen you indicate certain options. The first option Drop existing objects in script, when set to True, means that when you run the script, if there are any tables of the same name as the tables that you are about to export then those will be dropped or deleted from the database. Use this feature with care.
The next object, Schema qualify, generates a script that doesn't qualify object names. Next you indicate which version of SQL Server you are going to be using. I'm assuming that I'll be deploying to SQL Server 2008. But there is also support for the syntactical differences that you'll encounter if your target SQL Server installation is version 2000 or 2005. And finally in Types of data to publish, you can indicate whether you want to publish data only, schema and data, which is the default, or schema only, which would mean just the database structure.
After setting your options click Next. This is the Review Summary screen. After checking all of the options click Finish. I'll click Close and then I'll minimize everything to take a look at my Desktop. And I'll find the new file mybookstore.sql. I'll right-click on the file and then open the file in a Text Editor. And you'll see that the database file contains all the SQL commands that are needed to drop the existing structure in the target database, create the new structure and then populate the database with data which is done through all of these Insert commands that you'll find further down in the file.
To use this file, check the video earlier in this video series where I described how to import a database from an SQL Script file like this one. So now you have all the tools you need. To set up your Internet Information Services installation, install ASP.NET 3.5 and export your database structure and data to an SQL file that you can then import into your hosting provider or your dedicated SQL Server Instillation.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 100793 Viewers
61 Video lessons · 87640 Viewers
71 Video lessons · 71509 Viewers
56 Video lessons · 103438 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.