Connection string 1:data source=localhost,1433; User Id=sa; Password=123;initial catalog=test; Min Pool size=1; Max Pool Size = 512;
Connection string 2:data source=localhost; User Id=sa; Password=123;initial catalog=test;
TCP/IP in SQL Server database if not turned on, only the second sentence of the connection string, open is available. String 1 is done by walking the network.
If you apply the first string, you must turn on TCP/IP in the SQL Server Configurator and then restart the SQL Server service. Just OK.
Otherwise the error
System.Data.SqlClient.SqlException: A transport-level error occurred while sending a request to the server. (PROVIDER:TCP provider, error:0-the remote host forced the shutdown of an existing connection.) ) in System.Data.SqlClient.SqlConnection.OnError (SqlException exception, Boolean breakconnection) in System.Data.SqlClient.SqlInternalConnection.OnError (SqlException exception, Boolean breakconnection) in System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning ( Tdsparserstateobject stateobj) in System.Data.SqlClient.TdsParserStateObject.WriteSni () in System.Data.SqlClient.TdsParserStateObject.WritePacket (Byte flushmode) in System.Data.SqlClient.TdsParserStateObject.ExecuteFlush () in System.Data.SqlClient.TdsParser.TdsExecuteRPC (_sqlrpc[] rpcarray, Int32 timeout, Boolean Inschema, SqlNotificationRequest notificationrequest, Tdsparserstateobject stateobj, Boolean iscommandproc) In System.Data.SqlClient.SqlCommand.RunExecuteReaderTds (CommandBehavior cmdBehavior, Runbehavior Runbehavior, Boolean Returnstream, Boolean async) in System.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehavior cmdbehavior, Runbehavior Runbehavior, Boolean Returnstream, String method, dbasyncresult result) in System.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehavior cmdbehavior, Runbehavior Runbehavior, Boolean Returnstream, String method) in System.Data.SqlClient.SqlCommand.ExecuteReader (CommandBehavior Behavior, String method) in System.Data.SqlClient.SqlCommand.ExecuteReader (CommandBehavior behavior) in EISSQLServerDAL.SqlHelper.ExecuteReader (SqlConnection connection, sqltransaction Transaction, CommandType CommandType, String CommandText,
SQL Server connection string opens with TCP/IP