3

I have a problem that I have been researching for the last 2 days. I have a program I wanted to give to a friend. It uses a MDF local database file. But once he installs it on his computer, it gives a sql 50 error (Error 1).

I have installed basically everything I can install, he even installed VS and it did not work. I can't give a list of what I have installed because its way too long, but everything with the name SQL in it I have installed it on a VM, to test. On my pc(Not the VM) it works fine but on someone else it doesn't work.

Here is the connection string :

"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\DataBases\Software.mdf;Integrated Security=True".

I've added the ports to the firewall 1433. I have tryed to just add the database true the "Inport data"program form sql 2012 express also does not work. I just cant seem to get it to work. I also tryed to make a MSSQLLocalDB But I don't know how to. There is no good tutorial to do that.

Error 1: A netowkr-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 configurad to allow remote connections (Profider; SQL Network interfaces Error 50 - Localc Database Runtime Error occurred the specified localDB instance does not exist).

jarlh
  • 42,561
  • 8
  • 45
  • 63
Kevindt12
  • 109
  • 1
  • 10

1 Answers1

0

Try to run the following in cmd to create a new instance of localDB with v12.0 version

sqllocaldb create "v12.0"

Some additional details regarding the command: https://learn.microsoft.com/en-us/sql/relational-databases/express-localdb-instance-apis/command-line-management-tool-sqllocaldb-exe

Also, check your instance SQL Server(SQLEXPRESS) is running. Open SQL Server Configuration Manager -> Sql Server Services to verify it.

hastrb
  • 410
  • 4
  • 12
  • Have done that 3 times nothing. And for what am i supost to look for exactly in SQL Server Configuration Manager. – Kevindt12 Apr 22 '17 at 17:38
  • @kevindt12 that your service SQL Server(SQLEXPRESS) is in running state. – hastrb Apr 22 '17 at 18:02
  • Yes i did check that the Agents are the only things that are not running. – Kevindt12 Apr 22 '17 at 18:55
  • Okay i rember a error so i did it again. Here is the error : Creation of LocalDB instance "v12.0" with version 11.0 failed because of the following error: The parameter for the LocalDB Instance API method is incorrect. Consult the API documentation. – Kevindt12 Apr 23 '17 at 16:53