ASP.NET: how to deploy App_Data for web hosting?

I have uploaded my website to my web host and it works great apart from the form. When I try to login when I get this error:

A network related or instance specific error occurred while establishing a connection to SQL Server. The server was not found or was not available. Verify that the instance name is correct and configure SQL Server for remote connection. (Provider: SQL Network Interfaces, Error: 26 - Server / Instance Locating Error)

When I deploy a website, I publish it from Visual Studio to a local folder and then upload it to the web host via an FTP client program. The problem here is that the App_Data folder is empty when I publish the site to my local folder. Could this be the problem?

+2


source to share


2 answers


Check to see if the server allows custom instances to run. If allowed, you don't have to do anything and just upload the MDF file to the App_Data folder on the server and you're good to go. You can also enable App_data for publishing, which will automatically download the App_Data folder along with the content.

If your server does not allow user instances, then you need to follow these steps.

Ask your administrator to provide you with the SQLServer database along with the access credentials.

From your Visual Studio, right click on your database from the server explorer and select the PUBLISH TO PROVIDER option. Follow the instructions in the wizard and create a SQL script with or without default data.



alt text http://ruchitsurati.net/myfiles/db.png

Connect to a remote SQL Server from management studio and run the generated SQL script on the database specified by your administrator.

Update the connection string in the deployment app.

+2


source


Check the box "Include files from the App_data folder" when publishing.



alt text http://img260.imageshack.us/img260/8891/appdatapublish.png

+1


source







All Articles