Solved

How can find out if a datalist control has return no results?

Posted on 2008-06-16
1
161 Views
Last Modified: 2013-11-07
I have a datalist control that when some text box fields are filled out, a certain sql statement is executed and a query is populated.  

The results appear when the person hits a search that can populate results.  If there are no results to return i get no action.  I want to be able to check if the datalist rendered results or not.  
Protected Sub Search()
 
        Me.uxSearchDataList.DataSourceID = Me.uxSearchSqlDataSource.ID
 
        Dim sql as string = ""
 
        ..............
 
        Me.uxSearchSqlDataSource.SelectCommand = sql
 
    End Sub
 
    Protected Sub uxSearchButton_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
 
        Search()
 
    End Sub

Open in new window

0
Comment
Question by:mmedi005
[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
1 Comment
 
LVL 37

Accepted Solution

by:
samtran0331 earned 500 total points
ID: 21796290
Have you tried counting the datalist items?

        If uxSearchDataList.Items.Count = 0 Then
            'No items in datalist
        End If
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

687 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