retrieving "Data" from Listbox

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2005
Posts: 12
Reputation: Robert Walker is an unknown quantity at this point 
Solved Threads: 0
Robert Walker Robert Walker is offline Offline
Newbie Poster

retrieving "Data" from Listbox

 
0
  #1
Oct 4th, 2005
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!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC