I am using mvc3 to develop an database application and followed the Code-First Tutorial using Entity Framework 4 of msdn site….
I followed all the steps but unable to see the sdf file….
I can perform CRUD operations but can not see the physical database file inside the app_data folder
I also did "Show all file" but still it is not shown in my visual studio explorer…even my App_data folder is empty…
Code inside the web.config file:
<add name="Forum1Context"
connectionString="Data Source=|DataDirectory|\Forum.sdf"
providerName="System.Data.SqlServerCe4.0"/>
Please Help me!!
I experienced a similar issue. In my case, the name attribute in the add tag was not the same as the name of the class which inherited from DbContext. When I changed the name attribute to match, then I could see the .sdf file, but rows I had inserted previously into the database were lost.