|
-
May 2nd, 2003, 10:59 AM
#1
Thread Starter
Addicted Member
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,
-
May 2nd, 2003, 11:48 AM
#2
Sleep mode
Set the connection string , open the connection to database . Declare new dataset , dataadapter , datarow objects like this :
VB Code:
Dim mydataset As New DataSet()
MyAdapter.Fill(mydataset, TableStr)
Dim MyDataRow As DataRow = mydataset.Tables(TableStr).NewRow
MyDataRow("Column1") = ctrls0.Text
MyDataRow("Column2") = ctrls1.Text
MyDataRow("Column3") = ctrls2.Text
MyDataRow("Column4") = ctrls3.Text
mydataset.Tables(TableStr).Rows.Add(MyDataRow)
MyAdapter.Update(mydataset, TableStr)
-
May 2nd, 2003, 12:59 PM
#3
Thread Starter
Addicted Member
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|