Hi All,
I am trying to use the aspnet_regsql command to add asp.net schema to a database in the app_data folder of my project.
I ran this command:
aspnet_regsql -A all -C "Data Source=.\SQLEXPRESS;Integrated Security=True;User Instance=True" -d "C:\USERS\ALEX\DOCUMENTS\VISUAL STUDIO 2010\PROJECTS\ASPSLDB\ASPSLDB\APP_DATA\SLDBASP1.MDF"

This should add the schema to the database using the command line as the GUI cannot be used to do this as it does not recognise databases in the app_data folder.
The problem is when i do this i get the following error in visual studio when i try and access the db in the server explorer:

Database 'C:\Users\Alex\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS\C__USERS_ALEX_DOCUMENTS_VISUAL STUDIO 2010_PROJECTS_ASPSLDB_ASPSLDB_APP_DATA_SLDBASP1.MDF.mdf' already exists. Choose a different database name.
An attempt to attach an auto-named database for file C:\Users\Alex\documents\visual studio 2010\Projects\ASPSLDB\ASPSLDB\App_Data\sldbasp1.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Can anyone help with this problem please?
Thanks!
Alex

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.