0

I have just finished an app that is using a database.mdf. Everything is working well, but when I open the app on a different computer, I'm getting the following error:

"A network-related or instance-specific error occurred 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) "

Here is the database connection string:

Data Source=(LocalDB)\v11.0;AttachDbFilename=Z:\Items\ItemDatabase.mdf;Integrated Security=True;MultipleActiveResultSets=True;Connect Timeout=60

All computers have this network storage drive already mapped to the computer, but it only seems to work on my computer.

I have tried the double \\ but nothing worked. The names all match. What could it be?

Thanks

sergiogarciadev
  • 2,061
  • 1
  • 21
  • 35
user2851021
  • 71
  • 1
  • 9
  • Should have to mapped drive Z: on every computer that you opening your application – PEO May 14 '14 at 22:23
  • Could also be permissions. IIRC the user needs full read + write permissions and this error will be thrown if they don't. – Simon Whitehead May 14 '14 at 22:27
  • are there other things that have it open at the same time? – Keith Nicholas May 14 '14 at 22:29
  • on other computers, is `Z:` drive mapped to the exact same share? If `Z:` is mapped in a logon screen, and program is running as different user, could it be that `Z:` exists, but is pointing to a different folder? – LB2 May 14 '14 at 22:31
  • possible duplicate of [Connect to Server :A network-related or instance-specific error](http://stackoverflow.com/questions/18060667/connect-to-server-a-network-related-or-instance-specific-error) and about 50 others located searching here for the first sentence in the quoted error message (and not to mention the 200K+ results that turned up with a Google search on the same sentence, many of which were here). – Ken White May 14 '14 at 22:37
  • Look that he is using SQL Express LocalDB 2012 and the error message says "Error Locating Server/Instance Specified". It is not a problem with the file or the drive `Z:` – sergiogarciadev May 14 '14 at 22:42
  • Some things to check: http://www.sswug.org/articlesection/default.aspx?TargetID=44331 – B.K. May 14 '14 at 22:44
  • The article miss the SQL LocalDB, is a completely new way of access SQL Server. – sergiogarciadev May 14 '14 at 22:46

1 Answers1

1

The computer which you are trying to run the application must have the LocalDB installed.

You can download it from this link: http://www.microsoft.com/en-us/download/details.aspx?id=29062

sergiogarciadev
  • 2,061
  • 1
  • 21
  • 35
  • i tried your suggestion but i'm having permission issue with installing the sql server localdb.msi due to the computers are on a domain. you wouldn't happen to know of a different method or maybe a different type of database to use that wont request any kind on software install before use? – user2851021 May 15 '14 at 19:11
  • To install SQL Server Local DB you must be an administrator. It is one of main disadvantages when compared to SQL Compact DB. – sergiogarciadev May 16 '14 at 14:55