mysql timeout expired处理
一、发现问题

二、分析问题
.net长时间连接mysql导致超时;
方式一:连接用完后,就关闭连接
方式二:增加C#的执行sqlcommand时间
三、解决问题
增加了这一句,问题解决了
using (MySqlConnection conn = new MySqlConnection(mysqlCon.ConnectionString))
{
mysqlDa.SelectCommand.Connection = conn;
//0表上永久,默认是30
mysqlDa.SelectCommand.CommandTimeout = 0;
conn.Open(); MySqlTransaction tran = conn.BeginTransaction();
mysqlDa.SelectCommand.Transaction = tran;
mysqlDa.Fill(ds, "sp_AllInsert");
tran.Commit(); string returnStr = return_str.Value.ToString();
tbCompanyID.Text = returnStr;
MessageBox.Show(returnStr);
}
mysql timeout expired处理的更多相关文章
- MySql 长时间读数据发生超时的异常 Mysql Reader Exception TimeOut expired
mysql connector: .net var r = cmd.ExecuteReader() r.Reader() // <--长时间不停调用 Timeout expired. Th ...
- 错误记录-MySql.Data.MySqlClient.MySqlException (0x80004005): Timeout expired.
-- ::25.026 +: [ERR] Connection id "0HLQH64H76UL5", Request id "0HLQH64H76UL5:0000000 ...
- 连接池和 "Timeout expired"异常
转自:博客园宁静.致远:http://www.cnblogs.com/zhangzhu/archive/2013/10/10/3361197.html 异常信息: MySql.Data.MySqlCl ...
- 连接池和 "Timeout expired"异常【转】
异常信息: MySql.Data.MySqlClient.MySqlException (0x80004005): error connecting: Timeout expired. The tim ...
- error connecting: Timeout expired 超时时间已到. 达到了最大池大小 错误及Max Pool Size设置
[参考]Timeout expired 超时时间已到. 达到了最大池大小 错误及Max Pool Size设置 [参考][数据库-MySql] MySqlConnection error connec ...
- SSRS 2008 R2 错误:Timeout expired. The timeout period
今天遇到了Reporting Services(SQL SERVER 2008 R2)的报表执行异常情况,报表加载数据很长时间都没有响应,最后报"An error occurred with ...
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
今天碰到了一个查询异常问题,上网查了一下,感谢原创和译者 如果你使用的数据库连接类是 the Data Access Application Blocks "SqlHelper" ...
- SQLSERVER:Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
背景: 在最近开发中遇到一个问题,对一个数据库进行操作时,我采用64个并行的任务每个任务保证一个数据库连接对象:但是每个任务内部均包含有24个文件需要读取,在读取文件之后,我们需要快速将这24个文件批 ...
- Timeout expired超时时间已到. 达到了最大池大小 错误及Max Pool Size设置
此文章非原创,仅为分享.学习!!! 参考数据库链接串: <add key="data" value="server=192.168.1.123; port=3306 ...
随机推荐
- linux 硬件中断调节
什么是中断 中断interrupts是指硬件主动的来告诉CPU去做某些事情.比如网卡收到数据后可能主动的告诉CPU来处理自己接受到的数据,键盘有了按键输入后会主动告知CPU来读取输入. 硬件主动的打扰 ...
- jmeter的Classpath即类或者jar包的搜索路径设置
对于master-slave模式,插件和依赖都需要放到slave上才能生效,并且需要重启slave使插件生效 查看配置文件:apache-jmeter-3.1/bin/jmeter.propertie ...
- 怎样载入指定路径的Logback.xml
今天想外置logback.xml,谢了例如以下代码 File logbackFile = new File("./conf/logback.xml"); if (logbackFi ...
- 搭建ELK收集PHP的日志
架构: filebeat --> redis -->logstash --> es --> kibana 每个客户端需要安装filebeat收集PHP日志 filebeat把收 ...
- [TypeScript] Define Custom Type Guard Functions in TypeScript
One aspect of control flow based type analysis is that the TypeScript compiler narrows the type of a ...
- [Java Sprint] AutoWire
Previous we have seen constructore injection: https://www.cnblogs.com/Answer1215/p/9484872.html It w ...
- ZOJ 3819 Average Score 水
水 Average Score Time Limit: 2 Seconds Memory Limit: 65536 KB Bob is a freshman in Marjar Univer ...
- Maven+Mybatis+Spring+SpringMVC实现分页查询(附源代码)
以下小宝鸽将分享一篇Mybatis分页功能的博文,以下将给出具体的步骤.跟着博主的节奏肯定能实现.另外最后还会附上整个project的源代码.假设是没有使用过maven的猿友可自行下载相关的jar包就 ...
- openwrt-安装-驱动-应用-lcd2004a实验
1. 板子f403tech的RT5350的板子和 (1)openWRT系统的定义和特点 OpenWrt是一个高度模块化.高度自己主动化的嵌入式Linux系统.拥有强大的网络组件.经常被 ...
- c# GDI+绘制不同字体的字符串
一段字符串中可能既有汉字又有字母,对于汉字和字母分别采用不同的字体进行绘制直接po代码了 Bitmap bmp = new Bitmap(iWidth, iHeight); Graphics g = ...