I am unable to connect to a local SQL Server 2008 R2 trial version from Visual Studio 2010 Express.
When adding a new connection, I browse to the database file in this location:C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\AdventureWorks_Data.mdf
, I encounter this error:
Could not open new data base 'C:\PROGRAM FILES\MICROSOFT SQL SERVER\MSSQL10_50.SQLEXPRESS\MSSQL\DATA ADVENTUREWORKS_DATA.MDF'.CREATE DATABASE is aborted. An attempt to attach an auto-named database for file C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA AdventureWorks_Data.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. File activation failure.The physical file name "C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\AdventureWorks_Data_log.ldf" may be incorrect. The log cannot be rebuilt when the primary file is read-only.