Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am a newbie to ASP.Net MVC and trying out example applications from the books. I created a simple application in MVC 3 and I found MVC using a database to store user information's created under the App_Data folder of the project. I wanted to create and use a separate database other than which I can create using VS. So I created a database using SQL Server 2008 R2 Express under the App_Data folder of my web application and tried to add a new connection to that SQL Database file using .Net Framework Data Provider for SQL Server.

When I browse to the database file and tried to select, I am getting the error "You dont have permission to open this file. Contact the file owner to obtain the permission". I am trying to access the database using SQL Server authentication.

So, I have created a role and given the admin privileges to the database and added a user with that role. But still I am getting the error while trying to add the connection.

I'd like to know how to create an MVC application that stores it database internally inside its project and how to access it.

share|improve this question
1  
This question does not make sense. The WHOLE POINT of a database server is that it is external to the application not "stored inside". –  Hogan Oct 20 '13 at 17:46

1 Answer 1

  1. Create Your Database In Sql Server
  2. Export That Database File to .mdf file and place it In Your Project. Then You can Use that file as Database Internally.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.