I think the problem is that you're trying to do this on a detached SQLExpress database. You might have another copy of AdventureWorks that's actually permanently attached, which is why you're not seeing any errors.
Please try the following:
1) If you don't already have a copy of SQL Server Management Studio [Express], get it - it'll be easier to work with for this than Visual Studio.
2) Run the following script:
USE AdventureWorks
SELECT name, physical_name
FROM sys.database_files
3) If you get an error that says the database does not exist, skip to step 5. If you see physical_name
entries that don't match the local in your app_data
folder, continue to the next step. If you see entries that are in that same app_data
folder, then I'm stumped.
4) Run the following to detach the existing DB:
EXEC sp_detach_db 'AdventureWorks'
5) Run the following to attach the SQL Express DB for your app:
EXEC sp_attach_db 'AdventureWorks',
'C:\inetpub\wwwroot\MyApp\App_Data\ASPNETDB.MDF',
'C:\inetpub\wwwroot\MyApp\App_Data\ASPNETDB_log.ldf'
6) Run the aspnet_regsql tool again with the same options you used originally, except do not include .mdf
at the end of the database name.
7) Verify in SSMS[E] that the tables were created.
8) Detach the database again with EXEC sp_detach_db 'AdventureWorks'
(you'll need to do this if the app relies on ad-hoc attachment in its connection string, which I'm betting it does).