Question

we decided to start a new project using the Microsoft SQL Server R2 under Win7. I installed SQLEpress R2 on my system and it was decieded to called it BEACONExpress. At first we could not get it to run, until we had our Domain SysApp come in and set the ownership to my login. Now I was able to use SQL Management Studio to create the Database. I even added some Tables to it. Then I fired up VS 2010 and created a test program. When I try and access the new database, VS returns this error "The file can not be opened because it is being used by another process. Please close all applications that might access this file and try again."

If I attempt to create a new database under App_Data it returns this error. A network-related or instance-specific error occurered while establishing a connection to SQL server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified).

The connectionStrings in Web.config says

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

I found the database at C:\Program Files\Microsoft SQL Server\MSSQL10_50.BEACONEXPRESS\MSSQL\DATA\BeaconDB.mdf

I tried changing SQLEXPRESS to MSSQL10_50.BEACONEXPRESS but it had no affect. I have been reading here and on other forums trying to determine what is wrong but so far have not found an answer.

Was it helpful?

Solution

Have you verified that the Windows 7 firewall is configured to let you access the SQL Server? I had the same problem when triyng to access a database on my server at home, with Win7 x64.

Also, you should be sure to run the version SQL Server 2008 R2, because if R2 is not installed and all the updates are not installed, it will not work on Win7 x64

Maybe this link can help you: http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/1bb10896-27ed-4469-81e0-a84f4fba68c9

http://blogs.msdn.com/b/sqlexpress/archive/2005/05/05/415084.aspx

OTHER TIPS

Change your connection string element to

connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=BeaconDB" 

(Where BeaconDB is the name of your database)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top