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(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Me.PublishersTa bleAdapter.Fill (Me.PUBSDataSet .publishers)
Dim PubsDS As New PUBSDataSet()
Dim PubsTA As New
PUBSDataSetTabl eAdapters.publi shersTableAdapt er()= ("SELECT * FROM
publishers")
PubsTA.Fill(Pub sDS.publishers)
cboPubID.DataSo urce = PubsDS
cboPubID.ValueM ember = "pub_id"
cboPubID.Displa yMember = "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(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Me.PublishersTa bleAdapter.Fill (Me.PUBSDataSet .publishers)
Dim PubsDS As New PUBSDataSet()
Dim PubsTA As New
PUBSDataSetTabl eAdapters.publi shersTableAdapt er()= ("SELECT * FROM
publishers")
PubsTA.Fill(Pub sDS.publishers)
cboPubID.DataSo urce = PubsDS
cboPubID.ValueM ember = "pub_id"
cboPubID.Displa yMember = "pub_name"
Thanks,
Randy
Comment