|
-
Jun 17th, 2010, 06:40 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Inserting Large Amounts of Data
Hi all,
[.NET 3.5, Visual Studio C# 2008, OleDb connection, Access 2003]
As part of a database synchronisation program, I need to delete all the data in one table and replace it with the data in another. Currently I've been doing this by calling a DeleteAll() method, followed by looping over all the rows and calling a TableAdapter.Insert() method for each one.
This works, but it's slow: 5000 rows takes about half an hour, according to my users. For comparison, I can manually copy the same data in access in less than 5 seconds. That 5000 rows could easily end up as >50,000 rows by the end of the project, so that sort of performance is not an option.
I've been trying to use DataSetA.Table.Load(DataTableReader); and DataSetB.Table.CopyToDataTable(DataSetA.Table); but neither method has resulted in any change to the database. Either I don't understand how to use them properly, or they're not usable on designer-generated DataSets...
Is there any way of doing this? Any help would be appreciated.
Thanks,
Qu.
"Why do all my attempts at science end with me getting punched by batman?" xkcd.
| Pong| |
Sorry for not posting more often.
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
|