Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Development Tools
 Other Development Tools
 [VB 2010] populate ComboBox with Acces DB queries
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

iboumiza
Starting Member

Canada
9 Posts

Posted - 12/08/2011 :  00:54:51  Show Profile  Reply with Quote
Hi, this is the code I use to populate 3 combobox, but I just get only the first row in each combobox...

and I want also cboBox3 depend from cboBox2 depends from cboBox1, how can I do it?



Imports System.Data
Imports System.Data.OleDb
 
Public Class frm
 
Dim objConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = DBSOURCE\DB.mdb;Jet OLEDB:Database Password=pass;") 

Dim objdataadapter As New OleDbDataAdapter("SELECT * FROM table", objConnection) 
Dim objdataset As DataSet
Dim objdataview As DataView
 
Private objcurrencymanager As CurrencyManager
Private Sub userTableOptions() 
'objdataadapter = New OleDbDataAdapter
 
objdataset = New DataSet  
objdataadapter.Fill(objdataset,"staff") 
objdataview = New DataView(objdataset.Tables("staff")) 

' objcurrencymanager = CType(Me.BindingContext(objdataview), CurrencyManager)
 
End  Sub
 
Private Sub attachtextsuser() 

cboBox1.DataBindings.Clear()
cboBox2.DataBindings.Clear()
cboBox3.DataBindings.Clear()
cboBox1.DataBindings.Add("text", objdataview, "location") 
cboBox2.DataBindings.Add("text", objdataview, "director") 
cboBox3.DataBindings.Add("text", objdataview, "seller") 

End Sub
 
Private Sub frm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load 

userTableOptions()
attachtextsuser()

End Sub

End Class
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000