一、发现问题

二、分析问题

.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处理的更多相关文章

  1. MySql 长时间读数据发生超时的异常 Mysql Reader Exception TimeOut expired

    mysql connector: .net var r = cmd.ExecuteReader() r.Reader()   // <--长时间不停调用 Timeout expired.  Th ...

  2. 错误记录-MySql.Data.MySqlClient.MySqlException (0x80004005): Timeout expired.

    -- ::25.026 +: [ERR] Connection id "0HLQH64H76UL5", Request id "0HLQH64H76UL5:0000000 ...

  3. 连接池和 "Timeout expired"异常

    转自:博客园宁静.致远:http://www.cnblogs.com/zhangzhu/archive/2013/10/10/3361197.html 异常信息: MySql.Data.MySqlCl ...

  4. 连接池和 "Timeout expired"异常【转】

    异常信息: MySql.Data.MySqlClient.MySqlException (0x80004005): error connecting: Timeout expired. The tim ...

  5. error connecting: Timeout expired 超时时间已到. 达到了最大池大小 错误及Max Pool Size设置

    [参考]Timeout expired 超时时间已到. 达到了最大池大小 错误及Max Pool Size设置 [参考][数据库-MySql] MySqlConnection error connec ...

  6. SSRS 2008 R2 错误:Timeout expired. The timeout period

    今天遇到了Reporting Services(SQL SERVER 2008 R2)的报表执行异常情况,报表加载数据很长时间都没有响应,最后报"An error occurred with ...

  7. Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    今天碰到了一个查询异常问题,上网查了一下,感谢原创和译者 如果你使用的数据库连接类是 the Data Access Application Blocks "SqlHelper" ...

  8. 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个文件批 ...

  9. Timeout expired超时时间已到. 达到了最大池大小 错误及Max Pool Size设置

    此文章非原创,仅为分享.学习!!! 参考数据库链接串: <add key="data" value="server=192.168.1.123; port=3306 ...

随机推荐

  1. Critical Links-UVa796(无向图求桥)

    https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  2. P1996||T1282 约瑟夫问题 洛谷||codevs

    https://www.luogu.org/problem/show?pid=1996||http://codevs.cn/problem/1282/ 题目背景 约瑟夫是一个无聊的人!!! 题目描述 ...

  3. cogs——2419. [HZOI 2016]公路修建2

    2419. [HZOI 2016]公路修建2 ★☆   输入文件:hzoi_road2.in   输出文件:hzoi_road2.out   简单对比时间限制:1 s   内存限制:128 MB [题 ...

  4. spring依赖注入中获取JavaBean

    一.这个接口有什么用? 当一个类实现了这个接口(ApplicationContextAware)之后,这个类就可以方便获得ApplicationContext中的所有bean.换句话说,就是这个类可以 ...

  5. SQL server 2008 添加,删除字段

    添加,刪除字段 如果要在数据表中添加一个字段,应该如何表示呢?下面就为您介绍表添加字段的SQL语句的写法,希望可以让您对SQL语句有更深的认识. 通用式: alter table [表名] add [ ...

  6. Cocos2d-x旧引擎文件夹结构

    转自:http://blog.csdn.net/lwuit/article/details/7870395 Cocos2d-x的文件夹结构例如以下: 文件夹的详细结构介绍例如以下: Box2D:物理引 ...

  7. Scala-LIST/Tuple/Map

    环境: CentOS 6.3 LIST(列表) 代码: $ cat list.scala var mylist = List(1,2,3) println(mylist) var mylist1 = ...

  8. MFC自己主动获取网络地址函数实现----广播地址,网关,子网掩码

    void CSetSignalBoxDlg::OnBnClickedButtonGetbroadcastaddr() {       //凝视部分为还有一种获取IP方式,可略过 //char Name ...

  9. 怎样在win8系统下建立wifi热点

     2012年10月26日,微软正式推出Windows 8操作系统,不少用户也都升级到了最新的Win8.大家知道.在Win7系统下,我们非常方便的就在命令提示符下建立了WIFI热点.那么Win8上是 ...

  10. 打开google 新地址

    还在为谷歌打不开而发愁吗? 那就试试这个吧 91.213.30.151