View Single Post
  #6 (permalink)  
Old 10-03-2009, 07:57 AM
Ariel_Z's Avatar
Ariel_Z Ariel_Z is offline
Basic4ppc Veteran
 
Join Date: May 2009
Posts: 246
Default

You can try something like:
(Reader is a DataReader object, see this link: Basic4ppc SQL library reference - page 3)
Code:
1 Sub getOrderData
2    'Start transaction
3    Connection.BeginTransaction
4    'Set parameter values
5    Command.AddParameter("Tipo")
6    Command.SetParameter("Tipop""Bebida")
7    Command.CommandText="SELECT * FROM Productos WHERE Tipo=@Tipo"
8    'Fetch data
9    Reader.Value = Command.ExecuteReader
10    
11    'Assign data
12    Do While Reader.ReadNextRow = True
13        ComboBoxProductName.Add(Reader.GetValue(0)) ' if column #0 is name...
                 ' and ComboBoxProductName is the combobox you want to add to
14             ...

...
...

23    Loop
24    Reader.Close
25    ' End transaction
26    Connection.EndTransaction
27 End Sub
I did not test it. Check it out...

Last edited by Ariel_Z : 10-03-2009 at 07:59 AM.
Reply With Quote