Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 10th, 2003, 03:32 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default datagrid question...

hi, im trying to check is there any data binded to my datagrid from database, if there is no data, i need to show a label to user... but i dont know what is the properties to check... can any1 help? thanks...
here is some example that i tried b4....

dgData.DataBind()
  if dgData.Items is nothing then
   lblNo.Text="No record found"
  end if

dgData.DataBind()
  if dgData.DataBind() is nothing then
   lblNo.Text="No record found"
  end if
.
.
.

i think some of the code above is "stupid" for others... but... im stupid... Pls help, thanks again.

Regards
life's Ng

 
Old October 10th, 2003, 09:28 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I'd like to rephrase you're statement above:
it's "I'm learning". ;) (we all knew nothing at one point.)

dgData.DataBind()
if dgData.Items.Count = 0 then
  lblNo.Text="No record found"
end if

Peter
 
Old October 10th, 2003, 11:44 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default

yeah! thanks Peter!

Best Regards
life's Ng






Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid question hamil VB.NET 2002/2003 Basics 2 July 9th, 2004 05:59 AM
a DataGrid question eastboy ADO.NET 0 November 3rd, 2003 05:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.