Home > ADO.NET summarized
Book Excerpt:
EMAIL THIS

ADO.NET summarized

15 May 2006 | Wiley

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   

The following tip was excerpted from Chapter 1, 'Migrating from ADO to ADO.NET,' of the book Expert One-on-one Visual Basic 2005 Database Programming by Roger Jennings, courtesy of Wiley Publishers. Click here for the complete collection of book excerpts.


Microsoft designed the basic ADO.NET feature set to resemble that of ADO. The code to create a database connection with ADO.NET's SqlClient, OleDb, or Odbc managed providers is quite similar to that for ADODB.Connection objects. The same is true for ADO.NET's connection-specific commands and parameters. The primary differences between ADO and ADO.NET involve processing resultsets. DataReaders correspond to ADO's default forward-only, read-only Recordsets. The SqlClient data provider provides a substantial performance boost by eliminating the COM-based OLE DB layer and communicating with SQL Server 7.0 and later using SQL Server's native TDS protocol. ADO.NET data binding to typed DataSet objects and data-related event handling differ radically from ADO. Many experienced VB6 database developers discovered that migrating from ADODB Recordsets to ADO.NET 1.x DataAdapters, typed DataSets, and databound controls wasn't a walk in the park. Creating an ordinary data entry form with ADO.NET 1.x's DataGrid or other controls bound to a DataSet's DataTable and adding record navigation buttons involved writing much more code than that required for a corresponding VB6 project. To ease the pain of the transition from VS 6 to VS 2005,

ADO.NET 2.0 provides drag-and-drop methods for autogenerating the components and controls to create a basic, single-table form with the new DataGridView and DataNavigator controls, plus DataComponent and DataContainer components. Changing the DataGridView to a details view with individual databound controls takes only a minute or two.

The new drag-and-drop methods and component configuration wizards are useful for product demos by Microsoft's .NET evangelists, which elicit "oohs" and "aahs" from conference and user-group attendees. Autogenerated data entry forms can help programmers gain a basic understanding of ADO.NET data binding and flatten the ADO.NET learning curve. But you'll probably find that autogenerated forms aren't useful in real-world production applications. Amajor shortcoming is the default to parameterized SQL statements for data retrieval and update operations; most DBAs require stored procedures for all operations on base tables. Fortunately, you can intervene in the autogeneration process to specify and create the required stored procedures. Another issue is the BindingNavigator's lack of shortcut keys, which are a necessity for heads-down data entry. You'll discover other limitations of autogenerated forms and their workarounds as you progress through the book.

The preceding comments on databound control autogeneration doesn't apply to generating typed DataSets. Writing VB 2005 code for typed DataSets isn't a practical alternative. You can, however, create lightweight, untyped DataSets with only a few lines of code. Later chapters provide code examples to create untyped DataSets at runtime.

The following chapters of Parts I and II show you how to create production-quality Windows data entry forms by combining some of the techniques you learned in this chapter with DataSets, TableAdapters, and VB 2005 code to manage data retrieval, DataTable navigation, and multiple base table updates.

The above tip was excerpted from Chapter 1, 'Migrating from ADO to ADO.NET,' of the book Expert One-on-one Visual Basic 2005 Database Programming by Roger Jennings, courtesy of Wiley Publishers. Click here for the complete collection of book excerpts.

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
SQL Server Database Modeling and Design
Optimizing SQL Server indexes –- even when they're not your indexes
Top tips and tricks for SQL Server database development
Managing the development lifecycle with Visual Studio Team System 2008
A first look at Visual Studio Team System 2008 Database Edition
Testing transaction log autogrowth behavior in SQL Server
Top 10 SQL Server Tips of 2008
Tutorial: SQL Server indexing tips to improve performance
Tutorial: Learn SQL Server basics from A-Z
SQL Server database design disasters: How it all starts
Can you shrink your SQL Server database to death?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
binary tree  (SearchSQLServer.com)
block  (SearchSQLServer.com)
data structure  (SearchSQLServer.com)
DDBMS  (SearchSQLServer.com)
entity-relationship model  (SearchSQLServer.com)
initial extent  (SearchSQLServer.com)
primary key  (SearchSQLServer.com)
segment  (SearchSQLServer.com)
tablespace  (SearchSQLServer.com)
view  (SearchSQLServer.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary




Secure SQL - Data Security for Your Database
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts