Results 1 to 3 of 3

Thread: Insert Dataset into Database?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 1999
    Posts
    164

    Insert Dataset into Database?

    What is the best/fastest way to dump an entire dataset into an existing database? (going into MS Access)

    I have a blank Access MDB that I want to make a new table and just dump the contents of my dataset, etc.

    thanks,
    -Shurijo

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Set the connection string , open the connection to database . Declare new dataset , dataadapter , datarow objects like this :

    VB Code:
    1. Dim mydataset As New DataSet()
    2. MyAdapter.Fill(mydataset, TableStr)
    3. Dim MyDataRow As DataRow = mydataset.Tables(TableStr).NewRow
    4. MyDataRow("Column1") = ctrls0.Text
    5. MyDataRow("Column2") = ctrls1.Text
    6. MyDataRow("Column3") = ctrls2.Text
    7. MyDataRow("Column4") = ctrls3.Text
    8. mydataset.Tables(TableStr).Rows.Add(MyDataRow)
    9. MyAdapter.Update(mydataset, TableStr)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 1999
    Posts
    164
    Ex: MyExistingDS has 1000 records pulled via ODBC Connection to Oracle DB, next I want to dump that ds to Access.

    So I need to loop through each row in myExistingDS to populate the newDS?
    -Shurijo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width