I've been having a connection problem with SQL Server Express 2012, I cannot seem to connect to it from Unity, I keep getting the error message:
SocketException: An existing connection was forcibly closed by the remote host.
Code:
var connectionString: String =
"Server=Jay\\MSSQLSERVER" +
"Database=bfcrg;" +
"User ID=Myuserid;" +
"Password=mypassword;";
var dbcon: IDbConnection;
dbcon = new SqlConnection(connectionString);
dbcon.Open();
I did do some research & I found out that people have been having this same issue with SQL Server Express 2008 & Unity getting the same SocketException.
As one person had suggested, I uninstalled the server which was installed as a named instance (SQLExpress) & re-installed it as the default instance (MSSQLSERVER). But yeah that didn't fix it.
I have also checked it with the Firewall turned off so no it's nothing to do with the Firewall.
However, I can connect to the Server with the SQL Server Management Studio so the server seems to be working fine I suppose.
So if anyone has any ideas, please let me know!
Cheers! Thanks a lot!

server=.orserver=(local)(or specify the machine name) without an instance name.Server=Jay\\MSSQLSERVERpart.