Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gridview does not show up if there are no records in the database

Status
Not open for further replies.

vanisudha2000

Programmer
Joined
May 11, 2006
Messages
21
Location
US
Hello,
If there are no records in the database then the Gridview does not show up in the asp page.
Can you help me in giving code atleast to put some message on the page if the gridview does not have any records in the database.

Thanks in advance
 
Make a label, set it Visble=false. If the Rows.Count in your GridView is zero, display a message that says that there are zero returned records.

HTH
 
Thanks, I could get the message now. Now How do I show the Details grid when there are zero records in the database
and Insert a new record into the database.

I am not able to see the detailsView on the page , when there are no records in the database.

Can you please help me..
 
Add a button to the EmptyDataRow template. Set the CommandName property to "New" of the button.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top