日期:2014-05-18  浏览次数:20336 次

数据库连接区别
在PetShop中数据库是这样连接的
Data   Source=db;Initial   Catalog=MSPetShop4Profile;Integrated   Security=True
我平时用
server=(local);user   id=sa;password=sa;database=db;min   pool   size=4;max   pool   size=4;packet   size=1024


在PetShop4.0版本PetShop.DBUtility.SqlHelper中的
                public   static   SqlDataReader   ExecuteReader(string   connectionString,   CommandType   cmdType,   string   cmdText,   params   SqlParameter[]   commandParameters)   方法是不是应关闭
SqlConnection   conn   =   new   SqlConnection(connectionString);
SqlCommand   cmd


------解决方案--------------------
在PetShop4.0版本PetShop.DBUtility.SqlHelper中的
public static SqlDataReader ExecuteReader(string connectionString, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters) 方法是不是应关闭
SqlConnection conn = new SqlConnection(connectionString);
SqlCommand cmd
----------
这个你得看具体reader是怎么生成的,如果使用了这个CommandBehavior.CloseConnection
那么就得在调用这个方法的后面执行reader.close()就可以了,
------解决方案--------------------
帮忙顶
------解决方案--------------------
肯定会关闭的,只是你没还没找到在哪里,关闭。

应该是使用了CommandBehavior.CloseConnection