Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

datalist item count

Posted on 2006-07-14
4
Medium Priority
?
1,212 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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Loops Section Overview
Suggested Courses

783 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