I am trying to create a database file in the asp.net project in the App_Data folder, but all the time there is an error. I overloaded the PC, I entered VS as an administrator - it does not help. VS 2013 Ultimate, MS SQL Server 2014 is installed on the PC. Creating a database file Error creating DB file

  • Show the contents of the web.config - the studio should add there connection string to connect to the database. - PashaPash
  • The <connectionStrings> section was not there. I watched the video by connection, they prescribe this section manually <connectionStrings> <add name = "BookContext" connectionString = "Data Source = (LocalDB) \ v11.0; AttachDbFilename = '| DataDirectory | \ Bookstore.mdf'; Integrated Security = True "providerName =" System.Data.SqlClient "/> </ connectionStrings> and everything works. I tried, I have the same thing ... - Mikhail Vishnevetsky

2 answers 2

Problem solved! In the settings of the VS SERVICE-Parameters-Database Tools-Data Connections environment, the string (LocalDB) \ v11.0 was specified. I replaced it with the string that is in the name of the available servers (localdb) \ MSSQLLocalDB, now the database files are created and displayed in App_Data folder and of course in the server browser.

    Judging by the error, you have not created an instance of SQL Server LocalDB to which the studio is trying to connect.

    You need to create it manually:

    "C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SqlLocalDB.exe" с v11.0 
    • The Microsoft SQL Server \ 110 folder contains folders: KeyFile, License Terms, SDK, Shared. But the Tools folder you specified with all the subfolders and the SqlLocalDB.exe file is in the Microsoft SQL Server \ 120 folder. How to create manually? - Mikhail Vishnevetsky
    • Just use SqlLocalDB.exe of 120 - it will also work. - PashaPash
    • Wildly sorry, but how to use it ??? I really don't know ... - Mikhail Vishnevetsky
    • @ Mikhail Vishnevetsky open the console (cmd), drive a command from the answer into it. press enter :) - PashaPash
    • Created your database through the console. When executing the C: \ SqlLocalDB info command, three running databases are output: MSSQLLocalDB, ProjectsV12 One (this is my one created). In the VS project, a server appeared on the Browser tab of the SQL Server objects, but still the same error occurred while creating the database file in the App-Data folder .... - Mikhail Vishnevetsky