Solved

datalist item count

Posted on 2006-07-14
4
1,201 Views
Last Modified: 2008-01-09
Hello experts,

I have a panel which displays;-

Your search query returned 0 Results.
if no result was returned. and a datalist bound to an objectdatasource

How do I determine that my datalist is empty so I can display the message like so;-

if (datalist is empty)
{
  panel1.visible = true
}
0
Comment
Question by:claracruz
  • 2
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
orbulat earned 500 total points
Comment Utility
how about?

datalist1.Items.Count == 0
0
 
LVL 10

Expert Comment

by:orbulat
Comment Utility
you can use datalist1.Items.Count == 0 or DataSet1.Tables[0].Rows.Count == 0
0
 
LVL 7

Expert Comment

by:pradeepsudharsan
Comment Utility
 If IsNothing(datalist1) OrElse datalist1.Items.Count = 0 Then
            Response.Write("No records found")
   End If
0
 
LVL 7

Expert Comment

by:pradeepsudharsan
Comment Utility
In c#
      if(datalist1==null  ||  datalist1.Items.Count == 0)
                  {
                        Response.Write("No records found");
                  }
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now