0

I am using visual studio 2013.

I have done File -> New -> Project

I then choose Template -> Visual C# -> Web -> ASP.NET Web Application

Project name is set to WebApplication1.

When I press F5 to run the website it becomes a basic working website which user can register an account.

The problem that I am facing now is that how do I access the database that store the registered users? How can I manage the users? I intend in the future to publish it into a website. I need to find a way to backup the users.

Should I need to add in my own tables should I put them in a separate database or should I store it together with the database that comes with the project?

I cannot find any information on this. I suspect the keywords used for searching might be wrong. Can someone give me some suggestions?

2 Answers 2

2

The default template for asp.net creates a database to localdb which is a light version of sql server and will be installed with visual studio 2013, to see the generated database, browse to the AppData folder in your project and you will find a long file which contains some of your project name, this is the generated database. Now you can attach this db file into sql server through management studio if you have one or you can change the connection string to the sql server instance that you want with the database name that you want and rerun the application and you will get the database generated into the sql server that you set where you can do anything like any other database.

EDIT If you run and registered successfully one user in your application the database will be output there, there is a small icon in the solution Explorer in vs 2013 that shows the all files (hidden) files, as the database is not part of the solution. Try that icon and you should see the database file there.

Hope this helps.

Sign up to request clarification or add additional context in comments.

3 Comments

The "AppData" cannot be expanded in the visual studio 2013. There also nothing when I view it with the file explorer
If you run and registered successfully one user in your application the database will be output there, there is a small icon in the solution Explorer in vs 2013 that shows the all files (hidden) files, as the database is not part of the solution. Try that icon and you should see the database file there.
Show me your connection string.
0

The mdf file will appear in AppData folder once I register a user.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.