|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
populate combo box
I am trying to populate my combo box with the field companyname from my company table in SQL.
Any ideas anyone? thanks kristin |
|
#2
|
|||
|
|||
|
??
are you using a stored procedure or a dataenviroment? if i am unclear, how are you calling from vb to sql?
|
|
#3
|
|||
|
|||
|
dataenvironment...
|
|
#4
|
|||
|
|||
|
hope this helps
i will just assume that the sql side is all good, this is how i did it.
(this will populate the combo2 box with the rubber type selection from the SQL Database. This also RTrim the "variable" so the "variable has no trailing spaces after it.) (this one is for a smaller query) Load DataEnvironment1 With DataEnvironment1 'you will do .rscommand(whatever number it is here).state If .rsCommand5.State <> 0 Then .rsCommand5.Close End If cmpdno = frmStartup.Combo1.Text .Command5 cmpdno If .rsCommand5.BOF And .rsCommand5.EOF Then MsgBox ("No Data Found") End If txtbatchSP.Text = RTrim(DataEnvironment1.rsCommand5!Batchno) txtcmpd.Text = RTrim(DataEnvironment1.rsCommand5!compoundno) End With (this one is for a larger query and some error handling) Load DataEnvironment1 With DataEnvironment1 If .rsCommand1.State <> 0 Then .rsCommand1.Close End If cmpdno = Combo3.Text .Command1 cmpdno If .rsCommand1.BOF And .rsCommand1.EOF Then MsgBox "No Data for requested parameters !", vbExclamation MousePointer = vbDefault Exit Sub End If DataEnvironment1.rsCommand1.MoveFirst While Not DataEnvironment1.rsCommand1.EOF txtdescript.Text = RTrim(DataEnvironment1.rsCommand1!descript) DataEnvironment1.rsCommand1.MoveNext Wend End With good luck!!!! ![]() |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > populate combo box |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|