How to deploy Visual Studio 2010 Web Application Project with SQL database using Web Deploy?
Posted by AccuWebHosting.Com :: Heather S. on 29 December 2010 05:31 AM

This demonstration shows how to deploy Web Application project of Visual Studio 2010 having SQL database using Web Deploy method on AccuWebHosting server.

Step: 1

Open the project in Visual Studio 2010.

First of all, change the Configuration settings of your project. In general the status is set to Debug but for deployment you need to change it to Release status.

For configuration settings perform the following steps:

Click Build-> Configuration Manager...

From the Configuration Manager Dialog box figure out Active Solution Configuration option. From the drop down menu select Release status and then close the dialog box.

Screenshot of Configuration Manager setting

Step: 2

Add connection string in web.config file between <connectionStrings> ... </connectionStrings> 


<add name="testDBConnectionString" connectionString="Data Source=IP address of local machine;Initial Catalog=databaseName;User Id=databaseUser;Password=password;" providerName="System.Data.SqlClient"/>


Step: 3

Click on Project-> Package/Publish Settings

Select Package/Publish SQL option

Click on Import from Web.config button

In Database Entry Details specify the following information:

      1. Destination Database Information

Connection string for destination database:

Data Source=, 1533;Initial Catalog=databaseName;User Id=databaseUser;Password=password;


  databaseName- name of the database created from the WebsitePanel

  databaseUser - user assigned to database from the WebsitePanel

  password - which has been set for the database user

      2. Source Database Information

Mark Pull data and/or schema from an existing database option

Specify the Connection string for the source database as below:

Data Source=IPAddress;Initial Catalog=databaseName;User ID=sa;Password=password;


  IPAddress - local machine's IP address

  databaseName - name of the database created on local machine from SQL Server Management Studio

  sa - local user to access the database

  password - password of sa user

Step: 4

To deploy the application perform the following steps:

Click Build-> Publish <Web Application Name>

You can also use the Solution Explorer where, right click on the application name and then select Publish option

It will display following dialog box:

Screenshot of Web Deploy publishing method


Specify profile name if you want to change it otherwise by default it is Profile1

Change Publish Method to Web Deploy

In Service URL there are three options available:

      1. To deploy locally,




      2. To deploy the application remotely through Remote Agent Service,



     http://<IP Address of Remote Computer>

    3. To deploy the application through Windows Management Service, use the value specified by your Hosting Provider,




Next option is Site/Application. Its value must be in the form of <IIS Website Name> or <IIS Application Name>

For the local servers use the name of the website and application as specified in IIS Manager

For example,

     Default Web Site/<ApplicationName>

To publish the application remotely, use the value given by your hosting provider which contains a domain or domain and application name

For example,




Check "Mark as IIS application on destination" option

Check "Allow untrusted certificate"

In the Username and Password field specify your Control Panel login username and password that has been given either by your Administrator or by your Hosting Provider

Click on Publish

(43 votes)
This article was helpful
This article was not helpful

Comments (0)
Help Desk Software by Kayako Resolve