SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old October 12th, 2004, 12:14 PM
Kristin Kristin is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 56 Kristin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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

Reply With Quote
  #2  
Old October 12th, 2004, 12:40 PM
hack_programr hack_programr is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: akron, ohio
Posts: 33 hack_programr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 1 m 36 sec
Reputation Power: 0
??

are you using a stored procedure or a dataenviroment? if i am unclear, how are you calling from vb to sql?

Reply With Quote
  #3  
Old October 12th, 2004, 01:19 PM
Kristin Kristin is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 56 Kristin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
dataenvironment...

Reply With Quote
  #4  
Old October 12th, 2004, 01:39 PM
hack_programr hack_programr is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: akron, ohio
Posts: 33 hack_programr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 1 m 36 sec
Reputation Power: 0
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!!!!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > populate combo box


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway