连接未关闭。连接的当前状态为已打开
public dataBase()
{
//
// TODO: 在此处添加构造函数逻辑
//
//ConnStr = ConfigurationSettings.AppSettings[ "yxrcConnectionString "];
ConnStr = ConfigurationSettings.AppSettings[ "DataBase.ConnectionString "];
}
public dataBase(String Str)
{
try
{
this.ConnStr = Str;
}
catch (SqlException Ex)
{
throw new Exception(Ex.Message);
}
}
#region 打开及关闭数据库链接
/// <summary>
/// 返回SqlConnection对象
/// </summary>
/// <returns> 数据库链接对象 </returns>
public SqlConnection ReturnConn()
{
try
{
SqlConnection Conn = new SqlConnection(ConnStr);
Conn.Open();
return Conn;
}
catch (SqlException Ex)