关于Connection must be valid and open.
这个Bug真心很操蛋!
我的网站在公司做的运行一切都没问题,回家后咋自己的电脑上出现了Connection must be valid and open.这个问题。
我最后还是在英文网站的一个不起眼的小角落中发先解决办法。
先说一下这个bug的引起原因有几种!
1.sqlhelp有问题就不说了
2.多个标点“,“ 在大括号的最后面多个逗号
var param = new List<DbParameter>
{
new MySqlParameter("_pageIndex", pageIndex),
new MySqlParameter("_pageSize", pageSize),
new MySqlParameter("_count", MySqlDbType.Int32)
};
3.你的程序一切没问题,但是你的网速很烂,请求时间超时,这是需要你设置一下时间
var cmd = new MySqlCommand();
//网速很烂时要设置
cmd.CommandTimeout = 1200;
希望可以帮到大家!
关于Connection must be valid and open.的更多相关文章
- SQL Server Connection Pooling (ADO.NET)
SQL Server Connection Pooling (ADO.NET) Connecting to a database server typically consists of severa ...
- Reporting Services 错误案例一则
遇到一个有意思的Reporting Services报表的案例,在2015-01-30号的凌晨20分左右的时候,有人发现Reporting Services的速度非常慢,而且最后有抛出异常,当时不知道 ...
- php.ini
[PHP];;;;;;;;;;;;;;;;;;;; About php.ini ;;;;;;;;;;;;;;;;;;;;; PHP's initialization file, generally ...
- PHP配置详解
[PHP] ;;;;;;;;;;;;;;;;;;; ; About php.ini ; ;;;;;;;;;;;;;;;;;;; ; This file controls many aspects of ...
- C#使用DataSet Datatable更新数据库的三种实现方法
本文以实例形式讲述了使用DataSet Datatable更新数据库的三种实现方法,包括CommandBuilder 方法.DataAdapter 更新数据源以及使用sql语句更新.分享给大家供大家参 ...
- Network Address Translation(转载)
Network Address Translation 来源:http://alexanderlaw.blog.hexun.com/9791596_d.html 地址转换用来改变源/目的 ...
- 实现虚拟模式的动态数据加载Windows窗体DataGridView控件 .net 4.5 (一)
实现虚拟模式的即时数据加载Windows窗体DataGridView控件 .net 4.5 原文地址 :http://msdn.microsoft.com/en-us/library/ms171624 ...
- Windows下apache php wordpress配置
2. Use notepad to open httpd.conf config file. Make use the line "LoadModule rewrite_module mod ...
- CUBRID学习笔记 40 使用net修改数据
修改 connection.Open(); string queryString = "UPDATE nation set capital = 'X' where `code` = ...
随机推荐
- where can I find source of com.android.internal.R.styleable.AlertDialog_multiChoiceItemLayout?
I want to modify Alert dialog multi select layout. For my program I want two line multi-select item. ...
- MS SQLSERVER通用存储过程分页
最近在面试的时候,遇到个奇葩的秃顶老头面试官. 问:写过存储过程分页吗? 答:没写过,但是我知道分页存储的原理,我自己也写过,只是在工作中没写过. 问:那你这么多年工作中就没写过吗? 答:的确没写过, ...
- How to close existing connections to a DB
use master ALTER DATABASE YourDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE --do you stuff here A ...
- log4j异常问题
log4j:WARN No appenders could be found for logger 转自:最爱NBA 直接写我的解决办法:在src下面新建file名为log4j.propertie ...
- IO库 8.6
题目:重写7.1.1节的书店程序(P229),从一个文件中读取交易记录.将文件名作为一个参数传递给main. #include <iostream> #include <fstrea ...
- 独立版Jexus
一:下载资源包 把 jexus压缩包下载到linux临时文件夹中. cd /tmp wget linuxdot.net/down/jexus--x64.tar.gz 二,解压: tar -zxvf j ...
- 使用ajax异步提交表单
虽然这篇文章的标题是提交表单,但是主要的难点在于使用ajax提交文本域的内容, 在工作中的经常会需要ajax跨域的问题,通常的需求使用jsonp就可以得到解决,但是当前项目中有一个图片服务器,客户端需 ...
- php Mysql 和Mysqli数据库函数整合
PHP Mysql和Mysqli数据库函数整合 服务器如果支持mysqli函数将优先mysqli函数进行数据库操作 否则将调用mysql函数进行数据库操作 用法SQL::connect(host,us ...
- Filter - Surge.js模板引擎过滤器
版权所有,转载请注明出处:http://guangboo.org/2014/01/05/filter-surgejs-template-engine 过滤器在surge.js模板引擎中多处用到,其类似 ...
- mac apktool配置
Apktool:http://ibotpeaches.github.io/Apktool/install/ 最新版本2.0.1 dex2jar: https://github.com/pxb1988/ ...