企业库5.0 | RefCountingDataReader 不能强制转换为 SqlDataReader

 

英文参考方案(推荐 | 权威)

  http://entlib.codeplex.com/Thread/View.aspx?ThreadId=211288

本人的解说

  修改您以前的代码,以适应这种更新。代码如下

 其一:

RefCountingDataReader reader = (RefCountingDataReader) _database.ExecuteReader(select);
if (((SqlDataReader)reader.InnerReader).HasRows)

其二(我的解决方案):

直接使用 IDataReader 进行接收并进行后续的操作。

IDataReader Readers = db.ExecuteReader(dbCommand)

 

 

 

posted @ 2010-10-16 19:52  Athson Wang  阅读(297)  评论(0编辑  收藏  举报