Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi..

I am binding Gridview with a dataset.But i want to check that if dataset is empty, it will show an label "No Record Found".How to check whether dataset is empty??
Can anyone tell me the code for this..
Posted

1 solution

Hi,
I think it will help you....
C#
if(ds != null && ds.rows.count>0)
{
 gridview.datasource=ds;
 gridview.databind();
}
else
{
  label.text="No records found";
}
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900