|
-
Feb 28th, 2008, 05:21 AM
#1
Thread Starter
Frenzied Member
[2005] Inserting Datatable straight into Access Database
Hi All!
Hope you all are well.
I am basically storing all my user input into a datatable, and when the user finishes, i want to send that datatable into an Access Database.
Is there a quick way of doing it instead of opening a connection, using the insert command (with parameters) on each row, and looping to the end.
Can i map my datatable columns to the database columns.
Cheers
If you find my thread helpful, please remember to rate me 
-
Feb 28th, 2008, 06:01 AM
#2
Re: [2005] Inserting Datatable straight into Access Database
 Originally Posted by dinosaur_uk
Hi All!
Hope you all are well.
I am basically storing all my user input into a datatable, and when the user finishes, i want to send that datatable into an Access Database.
Is there a quick way of doing it instead of opening a connection, using the insert command (with parameters) on each row, and looping to the end.
Can i map my datatable columns to the database columns.
Cheers
I really believe though that looping through is the best way, its gives you allot more flexibility, plus you have the option to implement custom filters data check etc.
Pino
-
Feb 28th, 2008, 07:00 AM
#3
Re: [2005] Inserting Datatable straight into Access Database
There's no magic. You need to create a Connection, create a DataAdapter, create its InsertCommand, call its Update method and pass the DataTable.
If you create a Data Source in your project then the TableAdapter will be generated that does the first three steps for you, so all you need to do is call Update and pass the DataTable.
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
|