调用代码
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;
}
}
}
疯狂医院达什医生中文版(Crazy Hospital)
疯狂医院达什医生最新版是一款医院模拟经营类游戏,逼真的场景画
宝宝庄园官方版
宝宝庄园官方版是一款超级经典好玩的模拟经营类型的手游,这个游
桃源记官方正版
桃源记是一款休闲娱乐类的水墨手绘风格打造的模拟经营手游。玩家
长途巴士模拟器手机版
长途巴士模拟器汉化版是一款十分比真好玩的大巴车模拟驾驶运营类
房东模拟器最新版2024
房东模拟器中文版是一个超级有趣的模拟经营类型的手游,这个游戏