sql server连接字符串与tcp/ip开启
连接字符串1:Data Source=localhost,1433;User ID=sa;Password=123;Initial Catalog=test;Min Pool Size=1;Max Pool Size = 512;
连接字符串2:Data Source=localhost;User ID=sa;Password=123;Initial Catalog=test;
SQL SERVER数据库中的TCP/IP如果没有开启,只能用第二句连接字符串,开启都可用。字符串1是通过走网络的。
如果你应用了第一句字符串,必须在SQL server配置器中开启tcp/ip,然后重启sql server服务。就OK
否则报错
System.Data.SqlClient.SqlException: 在向服务器发送请求时发生传输级错误。 (provider: TCP 提供程序, error: 0 - 远程主机强迫关闭了一个现有的连接。) 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) 在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) 在 System.Data.SqlClient.TdsParserStateObject.WriteSni() 在 System.Data.SqlClient.TdsParserStateObject.WritePacket(Byte flushMode) 在 System.Data.SqlClient.TdsParserStateObject.ExecuteFlush() 在 System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc) 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) 在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) 在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) 在 EISSQLServerDAL.SqlHelper.ExecuteReader(SqlConnection connection, SqlTransaction transaction, CommandType commandType, String commandText,
sql server连接字符串与tcp/ip开启的更多相关文章
- SQL Server 连接问题-TCP/IP
原文:SQL Server 连接问题-TCP/IP 出自:http://blogs.msdn.com/b/apgcdsd/archive/2012/02/24/ms-sql-server-tcp-ip ...
- .NET SQL Server连接字符串句法
.NET SQL Server连接字符串句法 数据库的连接性已经发展成为应用程序开发的一个标准方面.数据库连接字符串现在已经成为每个项目的标准必备条件.我发现自己为了找到所需要的句法,经常要从另外一个 ...
- [ASP.NET]SQL Server 连接字符串和身份验证
SQL Server .NET Data Provider 连接字符串包含一个由一些属性名/值对组成的集合.每一个属性/值对都由分号隔开. PropertyName1=Value1; Property ...
- SQL Server 连接字符串和身份验证详解
SQL Server .NET Data Provider 连接字符串包含一个由一些属性名/值对组成的集合.每一个属性/值对都由分号隔开. PropertyName1=Value1; ...
- SQL Server 连接字符串和身份验证
SQL Server .NET Data Provider 连接字符串包含一个由一些属性名/值对组成的集合.每一个属性/值对都由分号隔开. PropertyName1=Value1;P ...
- Sql Server连接字符串
SQL Server .NET Data Provider 连接字符串包含一个由一些属性名/值对组成的集合.每一个属性/值对都由分号隔开. PropertyName1=Value1; ...
- SQL Server 连接字符串和身份验证 学习
SQL Server .NET Data Provider 连接字符串包含一个由一些属性名/值对组成的集合.每一个属性/值对都由分号隔开. PropertyName1=Value1; ...
- SQL Server 连接字符串备忘
今天把服务器上的远程访问关了,把连接字符串中的IP地址改成了.,然后就一直连不上.弄了半天,原来是本地连接时非默认实例,不能带端口号. 1.原来的连接服务器地址是:192.168.0.1SQL2005 ...
- JDBC 连Sql Server 接数据库--The TCP/IP connection to the host localhost, port 1433 has failed
原文:https://blog.csdn.net/qq_39241986/article/details/80848855 这样的错误,你有遇到过吗? The TCP/IP connection to ...
随机推荐
- C#语言正则用法
string phone =""; string pattern @"|\d{10}"; bool rusurt = false; Console.WriteL ...
- css实战第三天小结
1.谈一谈对层级的理解: 如果对两个并列的子元素都设置了相对于同一个父元素(如果没有设置父元素那么默认相对于浏览器而言)进行了定位(相对定位),则这两个都具有相同的层级(默认为0),他们的trbl也默 ...
- phpstudy远程连接mysql
格局如图所示执行以下命令 mysql -u root -p mysql>use mysql; mysql>select 'host' from user where user='root' ...
- tp3.2 支付宝app支付
pay方法 /** *支付宝支付 */ public function pay($param) { vendor('alipay.AopSdk');// 加载类库 $config = array( ' ...
- es6(10)--Set,Map(2)
//Map与Array的对比 { let map=new Map(); let array=[]; //增 map.set('t',1); array.push({t:1}); console.inf ...
- Spring boot 下使用 Swagger
通过Swagger 可以更好的将后台的RESTfull API文档化,如下图所示: 1. Swagger 主要依赖以下两个jar包: <!-- https://mvnrepository.com ...
- GNU coreutils
内核实用程序,针对文本及文件操作.涉及到102条linux命令.命令列表:cp.install.ln.mv.ls.echo…… 常见选项 1.退出状态 2.备份选项 cp, install, ln, ...
- java.lang.ClassNotFoundException: org.thymeleaf.spring5.view.ThymeleafViewRe。。。。。。。。。。。
直接上代码问题: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.boot.autoc ...
- ROS Industrial 简介
ROS_I means ROS Industrial ROS_I 解决了哪些问题: 1. 让自动化可以互相协作,操纵器.末端执行器.感知系统/传感器,移动平台,周边设备,都可只用一种语言(ROS me ...
- Python学习URL
Python 与 Excel 不得不说的事 http://www.open-open.com/lib/view/open1472701496085.html