I´ve to complete several card inserts into one table. Now, I´ve a listing of objects which i iterate, as well as for each object i actually do an ExecuteNonQuery using the place statement.

I wish to determine if you will find a faste method of doing this. In by doing this, placing 800 registers takes a few momemts.

I´ve utilized in Java the executeBatch method, who's with this propose, can there be anything similar in c#.

Regards !

Card inserts are [relatively] fast/cheap. Commits are slow/costly.

Unless of course it's a high latency connection, multiple (as with, 100s of) place claims ought to be all right.

"...requires a couple of minutes...Inch seems like transactions are not in use (and therefore you will find likely 800 commits -- ouch!). Among the simplest methods to control transactions in C# is by using a TransactionScope:

using (var connection = ...)
using (var tx = new TransactionScope()) {
   foreach (var row in rows) {
      // insert row
   }
   // commit all at once
   tx.Complete();
}

I'd only consider approaches if restricting the amount of transactions (and therefore commits) isn't sufficient to satisfy functional needs.

Happy coding.

Your statement might be something similar to this:

insert into my_table (field1, field2, ...)
values (row1_value1, row2_value2, ...),
       (row2_value1, row2_value2, ...), ...

If you create for instance a StringBuilder, you can batch up 20, 50 or 100 card inserts and problem a smaller amount place claims.

Have a look at Performing Batch Operations Using DataAdapters (ADO.NET) if you wish to fit everything in out of your .Internet application.

If you would like the quickest possible performance you could utilize the bcp utility (presuming you are using SQL Server.) You'd write your computer data to some delimited file and employ bcp to do the card inserts.

How about writting all of your place statement inside a string separated by '' and pass this string to ExecuteNonQuery ?

to check on for error just compare the amount of place using the row affected that ExecuteNonQuery return