Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

datalist item count

Posted on 2006-07-14
4
Medium Priority
?
1,210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
orbulat earned 2000 total points
ID: 17106534
how about?

datalist1.Items.Count == 0
0
 
LVL 10

Expert Comment

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

Expert Comment

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

Expert Comment

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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

715 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