Home > Interview Questions > ASP.NET > How do you display NO DATA FOUND when there is no record to display in gridview?

How do you display NO DATA FOUND when there is no record to display in gridview?

by Thamil   on 12/06/2013   Category: ASP.NET   |  Level: Beginner   |  Views: 7696    |  Points: 25     |  Gold 


In general, we are using gridview to display the records in search page, suppose if there is no data found from database for specific search and need to display as No data found message using gridview.

Actually we can achieve this in varies methods, here we will use EmptyDataText in gridview and show this message to the user.

<asp:GridView ID="GVtestNodataFound" runat="server" EmptyDataText="No data found!" ShowHeaderWhenEmpty="True">...


or use emptydatatemplate in gridview.

 <emptydatatemplate>No data found!</emptydatatemplate> 



« What are the two main components of .NET framework?
» How do you identify a process is 32 bit or 64 bit using C# program?
Post Question  |  Question Home

Recent Posts

User Responses


No response found, be the first to review this question.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts