ADO.NET 2.0 has introduced the concept of Batch Updates, which allows you to designate the number of commands sent to the database at a given time. If used correctly, this can increase the performance of your data access layer by reducing the number of roundtrips to the database.When you updated a database using the DataAdapter in .NET 1.1 each
command was sent to the database one at a time. This caused a lot of
roundtrips to the database. The DataAdapter has an UpdateBatchSize Property that allows you to set the number of commands that will be sent to the database with each request.
- UpdateBatchSize = 1, disables batch updates
- UpdateBatchSize = X where X > 1, sends x statements to the database at a time
- UpdateBatchSize = 0, sends the maximum number of statements at a time allowed by the server
... using (OracleCommandBuilder cm = new OracleCommandBuilder(da)) { da.UpdateBatchSize = 0; da.Update(dt); } PS. Oracle supports this features in Oracle Data Provider for .NET 10.2.0.2.20 Production
Related Terminology : Batch Update, ADO.NET 2.0, ODP.NET Release
|