B
barret bonden
I'd like to programatically move through a table (call it a recordset in
ADO ) and disply fields in a textbox. I've gotten as far as the code below
(which just loads a listbox) I assume I need to work with the dataadaptor ,
but have been unable to find info on the web as to how to do it - the hope
is to be able to work , record by record,; something like the .movenext
capacity in the recordset objects of DAO and ADO.
myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\t.mdb")
myConnection.Open()
'myCommand = New OleDbCommand("select * from main", myConnection)
Dim myDataAdapter As New OleDb.OleDbDataAdapter( _
"Select * from main", myConnection)
Dim myDataSet As New DataSet()
myDataAdapter.Fill(myDataSet, "main")
'Dim myReader As OleDb.OleDbDataReader
Dim DataViewManager1 As DataViewManager = myDataSet.DefaultViewManager
ComboBox1.DataSource = DataViewManager1
ComboBox1.DisplayMember = "main.First"
ADO ) and disply fields in a textbox. I've gotten as far as the code below
(which just loads a listbox) I assume I need to work with the dataadaptor ,
but have been unable to find info on the web as to how to do it - the hope
is to be able to work , record by record,; something like the .movenext
capacity in the recordset objects of DAO and ADO.
myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\t.mdb")
myConnection.Open()
'myCommand = New OleDbCommand("select * from main", myConnection)
Dim myDataAdapter As New OleDb.OleDbDataAdapter( _
"Select * from main", myConnection)
Dim myDataSet As New DataSet()
myDataAdapter.Fill(myDataSet, "main")
'Dim myReader As OleDb.OleDbDataReader
Dim DataViewManager1 As DataViewManager = myDataSet.DefaultViewManager
ComboBox1.DataSource = DataViewManager1
ComboBox1.DisplayMember = "main.First"