Local SQL Database won't connect on other computers

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

I installed basically everything I can install, it even installed VS and it didn't work. I cannot give a list of what I have installed because it is too long, but everything with the name SQL in it I installed it on the VM to check. On my computer (not in a virtual machine) it works fine, but on someone it doesn't work.

Here is the connection string:

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

      

I added ports to firewall 1433. I tried to just add the database true, so the "Inport data" program also doesn't work. I just can't get it to work. I also tried to do MSSQLLocalDB But I don't know how to do it. There is no good tutorial for this.

Error 1: An error related to Netowkr or a specific instance occurred while establishing a connection to SQL Server. The server was not found or was not available. Make sure the instance name is correct and that SQL Server is configured for remote connection (Profider; SQL Network Interfaces Error 50 - Localc Database Runtime Error The specified instance of localDB does not exist).

+3


source to share


1 answer


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

sqllocaldb create "v12.0"

      



Some more information about the command: https://docs.microsoft.com/en-us/sql/relational-databases/express-localdb-instance-apis/command-line-management-tool-sqllocaldb-exe

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

0


source







All Articles