在没有任何数据时进行无效的读取尝试。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 我写了一个存储过程:CREATE PROCEDURE Pdefault
@yonghu varchar(24)
 ASselect count(hid) as nodu from Thuiyi where riqi>getdate() and noread like '%'+@yonghu+'%'
union 
select count(Gid) from Tgongwen where noread like '%'+@yonghu+'%'
union 
select count(Pid) from Tputong where noread like '%'+@yonghu+'%'
GO但在提取时,变量@yonghu不同时,有的出现如下错误,有时不出现:
异常详细信息: System.InvalidOperationException: 在没有任何数据时进行无效的读取尝试。源错误: 
行 215: dr.Read();
行 216:
行 217: noPutong=dr["nodu"].ToString();
行 218: LPutong.Text="您有<b><FONT color=#ff3366>"+noPutong+"</font></b>个普通公文未阅!";
可是这三条select语句现在我分开来写,并显示出来,都正常;如果前两条结合也都正常,但三条就不行了,为什么?