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

asp.net 怎样判断数据库里有没有数据?
如数据库表是nb_JiaBanLog    

要查找加班时间大于36小时的..假如数据库里面没有要的数据.提示 "沒有數據 "

------解决方案--------------------

ReGrid1.DataSource=ds.Tables[ "table2 "].Rows.Count;--这里应该赋数据集,而你赋值的是数据记录的个数!!
ReGrid1.DataBind();
你的代码写错了!!!!!
应该如此
if(ds.Tables[ "table2 "].Rows.Count> 0)
{
ReGrid1.DataSource=ds.Tables[ "table2 "];
ReGrid1.DataBind();
}