RE: Database updating issue
From: Landley (anonymous_at_discussions.microsoft.com)
Date: 03/24/04
- Next message: Drebin: "Re: Display "Search in progress message" with threading"
- Previous message: olig: "Display "Search in progress message" with threading"
- In reply to: Mircea Pleteriu: "Database updating issue"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Mar 2004 09:46:11 -0800
Hi,
I have done something similar with 900,000 items on an informix database.
I started a transaction on the connection class, passed this to the dataadapter, invoked the Update method on the dataadapter and finally commit the transaction.
It wasn't clear if you meant the 2.5 to 3 seconds was including the call to the stored procedures or not. If this is the case, try threading the these calls to the stored procedure. You'll need separate database connections to perform this.
Another option is to use a collection of datatables and use threading to populate them. Call the update method on an array of dataadapters in separate threads also.
The last two options will need to be outside of a transaction.
Good Luck.
----- Mircea Pleteriu wrote: -----
Hi all,
I have to insert to my database's table around 200 items. Actualy, for each
new item that must be inserted an SQL stored procedure is invoked.
The stored procedure does some tasks and then inserts the item into the
table.
The items which must be inserted are passed to my code through a DataTable
object.
So, each row in this object must be inserted into the database.
To accomplish this task, the inserting of all rows, at the moment, I'm using
a SQLDataAdapter object with the insert command pointing to the SQL stored
procedure and invoking the Update() method.
It works fine, the items are all inserted successfully.
The big problem is that it takes around 2.5 - 3 seconds to insert 200 items.
Do you have any idea to make it faster?
Thanks,
- Next message: Drebin: "Re: Display "Search in progress message" with threading"
- Previous message: olig: "Display "Search in progress message" with threading"
- In reply to: Mircea Pleteriu: "Database updating issue"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|