如何Dispose?
我的类 DBOperate : System.ComponentModel.Component。写了如下的方法。可是,不过一阵子,为什么还是会出现连接已经达到最大连接数?
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
this.sqlConnection.Close();
this.sqlConnection.Dispose();
}