Friday, February 24, 2012

ASPNETDB.MDF in Visual Studio 2005 > ISP-hosted MS SQL

I am using (and making some enhancements to) the auto-generated ASPNETDB database in Visual Studio 2005. Now, I would like to deploy the application I have built (together with the data it contains and uses) to my ISP's ASP.NET 2.0 server and my freshly-purchased MS SQL database.

I haven't a clue how to do the above. Some other posts mention Entreprise Manager and Data Transformation Tools, but I really don't know where to start. I wonder if someone would be kind enough to go through each step in detail? Don't worry about sounding condescending... I really am a novice!

I apologise for the naivety of this message...!

Any and all help hugely appreciated!

Josh Ord-Hume

ANy response to your problem with ASPNETDB. I've got a similar problem and at this time it appears that you can't use the login controls in a remote-hosted environment. I'm starting to wish I had used ColdFusion.

Thanks,

Will

|||

In general, you can deploy the database by simply copying the mdf and ldf files. Shut down SQL Server and copy out the files.

Then the ISP can "attach" these to a new instance of SQL Server. This works as long as both versions of SQL Server are the same version.

Another common alternative is to backup the SQL Server database and then give the backup to the ISP and they can restore it to a new database on the SQL Server. To backup the database you can use Enterprise Manager GUI to do this, read the help topics on backup. You can use the BACKUP TSQL command to automate this as well (single TSQL command will create a backup of your database to a file). If you want to automate this and you do not care to understand the TSQL, you can turn on SQL Server Profiler, then backup the database using the GUI, then in SQL Profiler the TSQL command to backup the database will be logged and you can copy and paste this to backup the database again later using TSQL.

Most ISPs who host SQL Server will know how to restore a database from backup.

The only other issue you will have is setting up the proper connection string in your ASP.NET code. Ensure you use a configuration file for the connection string and this way the ISP can easily point the connection string to the proper SQL Server database.

No comments:

Post a Comment