Hello, here is my code; I have sucessfully made the two connection strings, dataAdapters etc...I also made a dataset which fills into a list box which gives me a visual confirmation that I am receiving data into my dataset from my first database connection string.
The problem is I can't figure out for the life of me how to transfer that data into the other database. I see alot of code out there but none of which I see is viable; i.e. it seems to be "Work arounds".
I got a majority of this figured out; I think; I just need to get the data from one database and put it into another Microsoft Access Database.
Thank you for what ever help any of you can offer.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim conStr As String = "Provider=Microsoft.JET.OL
EDB.4.0;da
ta source=C:\Databases\Source
Database\.
mdb"
Dim strDest As String = "Provider=Microsoft.JET.OL
EDB.4.0;da
ta source=C:\Databases\DestDa
tabase.mdb
"
Dim sqlStr As String = "SELECT * FROM site"
' Create connection object
Dim conn As OleDbConnection = New OleDbConnection(conStr)
Dim conn2 As OleDbConnection = New OleDbConnection(strDest)
' Create data adapter object
Dim da As OleDbDataAdapter = New OleDbDataAdapter(sqlStr, conn)
Dim da2 As OleDbDataAdapter = New OleDbDataAdapter(sqlStr, conn2)
' Create a dataset object and fill with data using data adapter's Fill method
Dim ds As DataSet = New DataSet
da.Fill(ds, "site")
' Attach dataset's DefaultView to the datagrid control
Dim dv As DataView = ds.Tables("site").DefaultV
iew
ListBox1.DataSource = dv
ListBox1.DisplayMember = "sitename"
End Sub
Start Free Trial