Saturday, February 25, 2012

ASPNETDB.MDF, My Own Database and Deployment

This question has been asked before, with vague responses

I'm using Visual Web Developer 2005 Express, SQL Server 2005 Express and SQL Server Management Studio Express.

When I create an application with Login controls, VWD automaticlly creates a ASPENTDB.MDF security database. I also create my own database for my application e.g. abc.mdf. In other words, I have two databases. However, my hosting company supports only one database. What do I (we) do?

I have seen articles on:aspnet_regsql . Does this create a new database with all the security features of ASPNETDB.MDF built into my new database i.e. abc.mdf?

(A) If yes, how do you run it with SQL Server Managment Studio Express? It sounds silly, but I need instructions here please ... Also, do you run this against abc.mdf or do you use it create abc.mdf?

(B) If not, how do you achieve a single database scenario?

I'm sure this is a very common deployment question, which is very confusing for most of us hobbyists that want to deploy their web applications

As I understand, by default the data for a application will be stored in the database (ASPENTDB.MDF ) automaticlly created by VWD--you can change your connection string to connect other databases and the data will be only put into 1 database. To understand how your website using the database, you can take a look at :

http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

If you want to maneger the database in Management Studio, you can detach the database from your application (right click it in Server Explorer), then attach it in Management Studio. You can refer to this article:

http://msdn2.microsoft.com/en-us/library/ms187858.aspx

|||

Thank you for the response. I have seen the first URL previously and have some questions on running theaspnet_regsql.exe utility

1. I do NOT have the full blown SQL Server 2005 version on my development machine (nor do I have it in my LAN). Do I need to have this in order for the aspnet_regsql utility to work?

2. I still want to develop and test locally and when satsified upload to the web hoster. If aspnet_regsql creates a full SQL Server 2005 database version for me locally, how do I manage it using VWD locally, because VWD works with the SQL Server 2005 Express version?

3. By running aspnet-regsql, does it fundamentally change VWD from using SQL Server 2005 Express thereafter for other new sites, projects and solutions on the same development machine? I do not want this to be the case

4. Can I undo or reverse the effects of running aspnet_regsql?

Cheers

No comments:

Post a Comment