R
Randy
Hi,
I'm trying to fill a combobox with values from a sql table. Data
seems to be connected fine. Apparently in VB Express sqlDataAdapter
doesn't work, or at least I can't make it work. Searching the help
information, it directed me to Table Adapters instead.
Can anybody help me with correcting this code. It doesn't like the
sql statement at the end of table adapters declaration line. How do I
get a sql statement to populate table values so that I can direct them
to the combobox?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.PublishersTableAdapter.Fill(Me.PUBSDataSet.publishers)
Dim PubsDS As New PUBSDataSet()
Dim PubsTA As New
PUBSDataSetTableAdapters.publishersTableAdapter()= ("SELECT * FROM
publishers")
PubsTA.Fill(PubsDS.publishers)
cboPubID.DataSource = PubsDS
cboPubID.ValueMember = "pub_id"
cboPubID.DisplayMember = "pub_name"
Thanks,
Randy
I'm trying to fill a combobox with values from a sql table. Data
seems to be connected fine. Apparently in VB Express sqlDataAdapter
doesn't work, or at least I can't make it work. Searching the help
information, it directed me to Table Adapters instead.
Can anybody help me with correcting this code. It doesn't like the
sql statement at the end of table adapters declaration line. How do I
get a sql statement to populate table values so that I can direct them
to the combobox?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.PublishersTableAdapter.Fill(Me.PUBSDataSet.publishers)
Dim PubsDS As New PUBSDataSet()
Dim PubsTA As New
PUBSDataSetTableAdapters.publishersTableAdapter()= ("SELECT * FROM
publishers")
PubsTA.Fill(PubsDS.publishers)
cboPubID.DataSource = PubsDS
cboPubID.ValueMember = "pub_id"
cboPubID.DisplayMember = "pub_name"
Thanks,
Randy