Search

Browse by Category
 
 
Hide Left Column
< Return to Safari Guides Main Page

Safari Guides

Topic: .NET

Optimizing ADO.NET code

There are several ways to increase the performance of ADO.NET code in your Web or Windows forms applications:

  1. Using DataReader Versus DataSet
  2. Managing Database Connections
  3. Choosing Your Data Provider Wisely
  4. Using "SELECT *" Sparingly
  5. Avoiding Automatically Generated Commands

Cover GraphicFor an introduction to these ADO.NET optimizations, take a look at the "Optimizing ADO.NET Code" Section in Chapter 23 of Sams Teach Yourself ADO.NET in 24 Hours from Sams Publishing.

Using column ordinals in ADO.NET rather than column names to retrieve data from a DataReader will improve application performance without hard-coding the ordinal values. This can be done by enumerating the column ordinals using the GetOrdinal( ) method and using those values to retrieve data from the DataReader.

Cover GraphicFor details on improving DataReader performance with column ordinals, read Recipe 9.7 of ADO.NET Cookbook from O'Reilly Media.


Company | Terms of Service | Privacy Policy | Contact Us | Help | 508 Compliance
Copyright © 25-N Safari Books Online. All rights reserved.