Link to home
Start Free TrialLog in
Avatar of Geo123
Geo123

asked on

Dealing with Nulls

Hi

Am allocating values from a Listbox to text boxes..... when there is nulls my program cracks up and throws an error

     txtType.Text = CType(lstRumbas.SelectedItem, DataRowView).Item(14)

 mind VB didnt like this either....... what best way of dealing with it? And what would VB.Net syntax be for picking up Null value and skipping past it without throwing error/ wobbly!!

cheers Geo
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If CType(lstRumbas.SelectedItem, DataRowView).Item(14) Not IsNull Then
           txtType.Text = CType(lstRumbas.SelectedItem, DataRowView).Item(14)
End If
Avatar of Geo123
Geo123

ASKER

Cheers guys.... am going with LearnedOne cos it was simple and neat.....

Thanks Real_McKoy but to use your version would mean changing over about 10 lines to 30ish.... or 10 long lines!!

Now if only I could allow editing and saving back the records...sigh

cheers George