M
martin
Hi,
I am looking for a method to check if an item (any item) is selected in a
particular listbox before deleteing it from my database, however I keep
getting errors,
The code I have is
lbSpecificProgram is a listbox.
If (Not IsDBNull(lbSpecificProgram.SelectedItem.Value)) Or (Not
lbSpecificProgram.SelectedItem.Value Is Nothing) Then
SpecificProgram.DeleteEntryForSite(lbSpecificProgram.SelectedItem.Value.ToSt
ring)
End If
However, if nothing is selected in the list box then an exception is thrown.
I realize that I could just catch the exception and throw it away but i
would rather use a conditional statement if this is possible.
any help is appreciated
cheers
martin
I am looking for a method to check if an item (any item) is selected in a
particular listbox before deleteing it from my database, however I keep
getting errors,
The code I have is
lbSpecificProgram is a listbox.
If (Not IsDBNull(lbSpecificProgram.SelectedItem.Value)) Or (Not
lbSpecificProgram.SelectedItem.Value Is Nothing) Then
SpecificProgram.DeleteEntryForSite(lbSpecificProgram.SelectedItem.Value.ToSt
ring)
End If
However, if nothing is selected in the list box then an exception is thrown.
I realize that I could just catch the exception and throw it away but i
would rather use a conditional statement if this is possible.
any help is appreciated
cheers
martin