已有打开的与此命令相关联的 DataReader,必须首先将它关闭。
求大神解决一下。已经用reader.Close()了。怎么还错误!
public static tbBook GetBookById(string BId)
{
string sql = "select * from tb_Book where Bookid =@Bookid";
using (SqlDataReader reader = connDBHelper.GetReader(sql, new SqlParameter("@Bookid", BId)))
{
try
{
if (reader.Read())
{
tbBook book = new tbBook();
book.Bookid = (string)reader["Bookid"];
book.Bookname = (string)reader["Bookname"];
book.Bookclass = BookClassService.GetBookClassById((int)reader["Bookclass"]);
book.Author = (string)reader["author"];
book.Image = (string)reader["image"];
book.Publish = (string)reader["publish"];
book.Banci = (string)reader["banci"];
book.Price = (double)reader["price"];
book.Language = (string)reader["language"];
book.Page = (int)reader["page"];
book.Number = (int)reader["number"];
book.Kuc = (int)reader["kuc"];
&nb