0

I used default Membership of ASP.NET. After formatting PC and installing SQL Server Managment Studio I run application, I can not access my ASPNETDB.MDF, but can access other DB. For example, when I try to register get so error: enter image description here

Connection string is so:

<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS; Integrated Security=SSPI; AttachDBFilename=|DataDirectory|aspnetdb.mdf; User Instance=true" providerName="System.Data.SqlClient"/>

How can I access ASPNETDB.MDF?

Jeyhun Rahimov
  • 3,769
  • 6
  • 47
  • 90
  • 1
    You are trying to connect to the `SQLEXPRESS` instance of SQL Server - do you **have** SQL Server **Express** installed? If not: you need to **create** your `ASPNETDB` database on the SQL Server instance that you have (as a database, accessing it using its logical database name, not the physical file name) – marc_s Nov 01 '12 at 07:44
  • Mmm.. I forgot install SQL Server Express 2008. I am installing it now, then will try, if can not solve, say about it again. – Jeyhun Rahimov Nov 01 '12 at 07:56
  • Thanks, I installed it, then it works – Jeyhun Rahimov Nov 01 '12 at 09:27

1 Answers1

0

There should be a folder named App_Data. The database file should be created inside this folder. What you need is make sure that the ASP.Net identity has enough access rights to this folder.

moudrick
  • 2,148
  • 1
  • 22
  • 34