Reputation: 21
Server Error in '/' Application.
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: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details. )
I'm not sure, after I created a network service the problem occurs:
USE [master];
CREATE LOGIN [NT AUTHORITY\NETWORK SERVICE] FROM WINDOWS;
EXEC sp_addsrvrolemember N'NT AUTHORITY\NETWORK SERVICE', SYSADMIN;
I have tried to use different connection string to test my connection
Data Source=(localdb)\mssqllocaldb
//publishing and compiling error
But if I build & publish templating direct to local IP for the connection string, the error does not appear...
Data Source=192.168.100.233
//compiling error
I have no idea about this problem..
Upvotes: 2
Views: 6664
Reputation: 7439
You may have a firewall issue 1433 or you did not setup MixedMode Authentication
, you need to open the ports from services.msc
and look for sql server services
and under TCP and named pipes
To begin - there are 4 issues that could be causing the common LocalDb SqlExpress Sql Server connectivity errors SQL Network Interfaces, error: 50 - Local Database Runtime error occurred
, before you begin you need to rename the v11 or v12 to (localdb)\mssqllocaldb
I found that the simplest is to do the below - I have attached the pics and steps for help.
First verify which instance you have installed, you can do this by checking the registry and by running cmd
cmd> Sqllocaldb.exe i
cmd> Sqllocaldb.exe s "whicheverVersionYouWantFromListBefore"
if this step fails, you can delete with option d
cmd> Sqllocaldb.exe d "someDb"cmd> Sqllocaldb.exe c "createSomeNewDbIfyouWantDb"
cmd> Sqllocaldb.exe start "createSomeNewDbIfyouWantDb"
Upvotes: 3