SolutionCottage.com
Posted  24 Oct 2008 - 16:36:50

Category: SQL


Export aspnetdb to a production server

Issue:
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)"

Solution:
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":

http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en

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




0 comments:








© SolutionCottage 2008-2011 9/24/2017 1:06:28 PM