Posted  24 Oct 2008 - 16:36:50

Category: SQL

Export aspnetdb to a production server

I had created a local website using Visual Studio 2008 using membership management. This is created in a local database called ASPNETDB.MDF. The problem is that on a production server this might not work / be a handy solution. I got the error:

"Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

I solved the problem by using the database I already had on the production server. I use godaddy as provider and they have an option in the SQL management to install "ASP Schema" which fills the database with basically the same structure as ASPNETDB.MDF. To avoid problems with collation of tables (they might differ), I exported only the content of my MDF to a SQL script and executed this on the server. I exported the MDF using the "Database Publishing Wizard":

After you install this application you can export the content by opening the "Server Explorer" in VS2008 and right click the ASPNETDB.MDF and choose "Publish to Provider". In the step "Select Publishing Options", choose "Data Only" under "Types of data to publish".

Marked as helpful by 7 users


© SolutionCottage 2008-2011 7/26/2017 1:44:33 AM