kdeutsch
asked on
Get the return of a listbox
I am try9ing to see if a list box retuns anything, so that I can send a message tot he user that nothing was found.
I have tried theses
lbPers.items.counts = 0
lbPers.items = 0
lbpers.itmes.counts = ""
I have tried theses
lbPers.items.counts = 0
lbPers.items = 0
lbpers.itmes.counts = ""
If txtSearch.Text = "" Then
RegisterClientScriptBlock("showMessage", "<script language=""JavaScript""> alert('Type in a Personnel Name First.'); </script>")
Else
sql = "Select Distinct strSSN, strName + '|' + Substring(strSSN, 6,9) from tblPermTask where strname like '" & Name & "%' " _
& "Order by strName + '|' + Substring(strSSN, 6,9), strSSN"
lbPers.Items.Add(New ListItem("Click Person to Add", "0"))
buildDD(sql, lbSoldier)
End If
If lbPers.Items = 0 Then
RegisterClientScriptBlock("showMessage", "<script language=""JavaScript""> alert('Personnel does not currently have any Issues.'); </script>")
End If
txtSearch.Text = ""
ASKER
Hi,
Still using asp.net 1.1 and IS NULL or ISNULL of DBNULL are all incorrect and give blue underlines, never been able to solve that one.
Still using asp.net 1.1 and IS NULL or ISNULL of DBNULL are all incorrect and give blue underlines, never been able to solve that one.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use lbPers.Items = null instead.
ASKER
carl_tawn
Ok the == did not work for me but the follwoing did
If lbPers.Items.Count <= 1 Then
You got me think that my count really starts at 2 because I add in the click even to check that they picked on a person.
Ok the == did not work for me but the follwoing did
If lbPers.Items.Count <= 1 Then
You got me think that my count really starts at 2 because I add in the click even to check that they picked on a person.
Ah yes, sorry, should have been a single =. Put it down to a bit of C# to VB cross-over :o)
lbPers.items IS NULL