The following code is me loading a listbox with a table. I have no problem with the retrieving data if data has information, but if the field is empty I get a error. how can I check the field in a listbox first for DBnull?
'***1. load listbox from table
vStr = "Select social&' '&name as entry, title, street, RowNumber"
vStr += " from EmpAdds where "
vStr += " id_code = " + CType(cbEMPL.SelectedValue, String)
oCont = VB_LIB.MAIN.SQLSelect(vStr, oACC)
If oCont.Rows.Count > 0 Then
Me.lbOwnrInfo.DataSource = oCont
Me.lbOwnrInfo.DisplayMember = "entry"
Me.lbOwnrInfo.ValueMember = "RowNumber"
endif
'***2. Get Data from Listbox
temp = me.lbOwnrInfo.SelectedItem("street")
Thanks for any help!