Databases Reference
In-Depth Information
// Build the Update rules
// Specify how to update data in the data set
myDataAdapter.UpdateCommand = new
OracleCommand(
"UPDATE department SET deptname = ? ", deptid = ? " +
"WHERE rowid =?", DBConn);
// Bind parameters
myDataAdapter.UpdateCommand.Parameters.Add(
"param1", OracleDbType.VarChar, 100, "deptname");
myDataAdapter.UpdateCommand.Parameters.Add(
"param2", OracleDbType.Number, 4, "deptid";
myDataAdapter.UpdateCommand.Parameters.Add(
"param3", OracleDbType.Number, 4, "rowid");
Summary
The performance of .NET applications can suffer if they fail to reduce network
traffic, limit disk I/O, simplify queries, and optimize the interaction between the
application and data provider. Reducing network communication probably is the
most important technique for improving performance. For example, when you
need to update large amounts of data, using arrays of parameters rather than
executing an Insert statement multiple times reduces the number of network
round trips required by the data provider to complete the operation. In addition,
using a 100% managed data provider, which eliminates calls outside the CLR to
client libraries or code written before the .NET Framework was developed, can
improve performance, especially when the application is running on a busy
machine.
Typically, creating a connection is the most performance-expensive task
your application performs. Connection pooling can help you manage connec-
tions efficiently, particularly if your application has numerous users. Regardless
of whether your application uses connection pooling, make sure that you close
connections immediately after your application is finished with them.
Making smart choices about how to handle transactions can also improve
performance. For example, using manual commits instead of auto-commit mode
provides better control over when work is committed. Similarly, if you don't need
 
Search WWH ::




Custom Search