Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
291 views
in Technique[技术] by (71.8m points)

c# - Problem with connecting to SQL Server 2012 Express LocalDb in Visual Studio 2019 on 32 bit system

I have created a C# project using VS 2019 which connects to LocalDb.

Any machine which has 64 bit, I install SQL Server 2016 LocalDb before running my project and after that it works fine.

Now some machines are using 32 bit operating system, so I installed SQL Server 2012 Express LocalDB.

But my project is not working and I get this error:

System.Data.SqlClient.SqlException: "A network or specific instance error occurred while establishing a connection to SQL Server. The server could not be found or is unavailable. Make sure the instance name is correct and that remote connections are allowed on SQL Server. (Provider : SQL Network Interfaces, error: 50 - A Local Database Runtime error occurred. An unexpected error occurred while calling the LocalDB instance API method. For more information about the error, see the Windows Application Event Log.

This is my connection string:

Server=(LocalDB)MSSQLLocalDB;Integrated Security=true;AttachDbFileName=D:DataTestDB.mdf

Any help would be appreciated.

Thanks

question from:https://stackoverflow.com/questions/65557779/problem-with-connecting-to-sql-server-2012-express-localdb-in-visual-studio-2019

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...