| | |
retrieving "Data" from Listbox
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2005
Posts: 12
Reputation:
Solved Threads: 0
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!
'***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!
![]() |
Similar Threads
- Get data from Access instead of Notepad (URGENT) (C#)
- Transferring data to Excel (ASP.NET)
- Controlling GridView with a ListBox(multible selections enabled) (ASP.NET)
- Binary resource data (C)
- Populate Listboxes with table data (VB.NET)
- HELP:Data Files (C)
- Login and retrieve user data from database (ASP.NET)
- HELP!! "the document contains no data"?? (Windows NT / 2000 / XP)
Other Threads in the VB.NET Forum
- Previous Thread: Problems with connections
- Next Thread: Web cam programming using VB.net on window 2000
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access arithmetic array assignment basic binary bing box button buttons center check code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist editvb.net excel file-dialog firewall folder ftp google hardcopy image images isnumericfuntioncall listview login math memory mobile ms mssqlbackend mysql navigate net networking opacity output peertopeervideostreaming picturebox picturebox1 port print printpreview problemwithinstallation project record reports" save savedialog searchbox serial soap sorting string tcp temp text textbox timer toolbox trim updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio web wpf





