最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net 数据库访问组件支持Using
时间:2022-06-25 06:51:24 编辑:袖梨 来源:一聚教程网
调用代码
private void testusing()
{
using (idbhelper dbhelper = new sqlhelper(basesysteminfo.usercenterdbconnection))
{
dbhelper.executenonquery(" select getdate() ");
}
}
源代码。
//------------------------------------------------------------
// all rights reserved , copyright (c) 2010 , jirisoft , ltd.
//------------------------------------------------------------using system;
using system.data;
using system.data.common;
using system.io;
using system.text;namespace dotnet.dbutilities
{
using dotnet.utilities;///
/// basedbhelper
/// 有关数据库教程连接的方法。
///
/// 修改纪录
///
/// 2011.01.29 版本:3.1 jirigala 实现idisposable接口。
/// 2010.06.13 版本:3.0 jirigala 改进为支持静态方法,不用数据库open、close的方式,autoopenclose开关。
/// 2010.03.14 版本:2.0 jirigala 无法彻底释放、并发时出现异常问题解决。
/// 2009.11.25 版本:1.0 jirigala 改进connectionstring。
///
/// 版本:3.1
///
///
///jirigala
///2011.01.29
///
///
public abstract class basedbhelper : idisposable // idbhelper
{代码省略
public void dispose()
{
this.dbcommand = null;
this.dbdataadapter = null;
this.dbtransaction = null;
// 关闭数据库连接
if (this.dbconnection != null)
{
if (this.dbconnection.state != connectionstate.closed)
{
this.dbconnection.close();
}
}
this.dbconnection = null;
}
}
}
相关文章
- 学信网官方登录入口-个人学历学位认证查询系统 12-20
- 原神AKT资源站网页入口-AKT原神官网链接直达地址 12-20
- CET4准考证成绩防伪验证官方入口-CET4准考证成绩下载快速指南入口 12-20
- yandex网站突然打不开-俄罗斯搜索引擎最新可用入口2025 12-20
- cet4成绩快速查询入口-cet4成绩官方查询入口官网 12-20
- 抖币充值官网入口-抖币充值官网入口1:10 12-20