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 ...
随机推荐
- 2011 ACM-ICPC 成都赛区A题 Alice and Bob (博弈动规)
题目大意: 有K堆石子,每堆有Ki个.两人的操作能够是: 1 从某一堆拿走一个 假设该堆在此之后没有石子了.就消失 2 合并两个堆 求是否 ...
- AutoCAD菜单加载失败 找不到文件mnc 怎么办
菜单加载失败,找不到文件 SWFILECONV(mnu/mns/mnc) 找到CAD安装目录下的swfileconv.arx文件,用记事本打开,清空内容,然后保存即可.
- ios网络学习------11 原生API文件上传之断点续传思路
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaHVhbmcyMDA5MzAzNTEz/font/5a6L5L2T/fontsize/400/fill/I0 ...
- Hibernate学习笔记(六) — Hibernate的二级缓存
我们知道hibernate的一级缓存是将数据缓存到了session中从而降低与数据库的交互.那么二级缓存呢? 一.应用场合 比方.在12306购票时.须要选择出发地与目的地,假设每点一次都与数据库交互 ...
- [Qt总结篇]终端远程升级client
环境: QT4.8.5 for Windows(Qt Creator+MinGW) 一.写在前面: 1.深度:鉴于C/C++的功底还远远不足,个人主要精力还是学习C/C++,所以没打算继续深入研究Qt ...
- Message: SyntaxError: unterminated string literal
#Message: SyntaxError: unterminated string literalmytxt = words.replace('\n','').replace('\r','') js ...
- 00020970-0000-0000-C000-000000000046
00020970-0000-0000-C000-000000000046 System.InvalidCastException: 无法将类型为“Microsoft.Office.Interop.Wo ...
- APDU报文【转】
本文转载自:http://www.cnbolgs.com/snail0404/p/5436348.html APDU # APDU # 定义:APDU(ApplicationProtocolDat ...
- POJ 2629:Common permutation
Common permutation Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5510 Accepted: 168 ...
- 今晚的两道 bc
第一道题 Beautiful Palindrome Number ,简单组合计数问题,手算打表就好~大概十五分钟左右搞定[第一次 提交竟然 wa了一次 有一个小小的坑在那.... /******** ...