public SqlDataAdapter ada;
protected virtual void Dispose(bool disposing)
{
if (disposing && (this.ada != null))
{
if (this.ada.SelectCommand != null)
{
if (this.ada.SelectCommand.Connection != null)
{
this.ada.SelectCommand.Connection.Dispose();
}
this.ada.SelectCommand.Dispose();
}
this.ada.Dispose();
this.ada = null;
}
}
--------------
这是我看别人的代码所定认的一个虚方法,但我不知在什么情况下用此方法?在整各项目中也没有发现此方法的调用.
protected virtual void Dispose(bool disposing)
{
if (disposing && (this.ada != null))
{
if (this.ada.SelectCommand != null)
{
if (this.ada.SelectCommand.Connection != null)
{
this.ada.SelectCommand.Connection.Dispose();
}
this.ada.SelectCommand.Dispose();
}
this.ada.Dispose();
this.ada = null;
}
}
--------------
这是我看别人的代码所定认的一个虚方法,但我不知在什么情况下用此方法?在整各项目中也没有发现此方法的调用.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货