Cannot Connect ASP.NET Database to SQL Server Management Studio

I have an ASP.NET MVC3 project with a database. I want to bind this database to SQL Server Management Studio.

In SQL Server Management Studio, right-click Databases , then click Attach , then click Add and display the folder / file selection dialog.

The problem is that it will not allow me to examine any folder inside my user account ( c:\users\Bob ). I can see the Bob folder, but there is no + extension and it does not show children (although I know that there are files in the Windows user folder). Why does this not allow me to explore there?

SQL Server Management Studio is version 11.0.21 (SQL Server 2012)

I tried to select All files in the filter drop-down list instead of *.mdf , but the files are not displayed.

+6
source share
2 answers

Two other things to note:

  • “Attach” looks in the default directory “DATA”, which is configured for the server, as shown below.
  • You may or may not have a * .ldf file. When you try to connect, SSMS considers that you have it, so if you do not, you will have to click 'remove' in this file in the list of files to attach.

Default DATA directory in SSMS for SQL Server

0
source

Although this question is two years old, I had the same problem.

I solved this by giving MS SQL Server Express access to my user folder.

Open Windows Explorer and find your user folder, right-click and select "Properties", then the "Security" tab.

I had to add a virtual user who uses the SQL server to access files, so I clicked on “Edit” and then in the next window clicked “Add”.

You will not know the virtual name to use, so just click "Advanced", then "Find Now" and Windows will display a list of all users. Scroll down and find something like:

SQLServerMSSQLUser $

(you will need to drag the separator in the row (in the column header) to the right to see the full names)

Return to the Permissions window, give full control to the SQL user.

0
source

Source: https://habr.com/ru/post/921089/


All Articles