Home > ADO.NET summarized
Book Excerpt:
EMAIL THIS LICENSING & REPRINTS

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
.NET development for SQL Server
FAQ: How to troubleshoot and grant SQL Server permissions
Secure SQL Server from SQL injection attacks
Code to restore SQL Server databases in VB.NET
Custom VB.Net scripting in SQL Server Integration Services
Connect to SQL Server database with Visual Basics
SQL Server Blog Watch
Top 10 SQL Server development questions
Developing CLR database objects: 10 tips, 10 minutes
CLR architecture
Creating CLR database objects
.NET development for SQL Server Research

SQL Server 2005 (Yukon)
SQL Server consolidation: Why it's an optimization technique
Parent-child dimensions in SQL Server 2005 with Analysis Services MDX
Using SQL Server datetime functions GETDATE, DATENAME and DATEPART
SSIS error message due to installation problem on SQL Server 2005
SQL Server data conversions from date/time values to character types
Basics for working with DATETIME and SMALLDATETIME in SQL Server 2005
How to configure Database Mail in SQL Server 2005 to send mail
How to use rank function in SQL Server 2005
Manage traces in SQL Server 2005 Analysis Services with XMLA commands
Tutorial: SQL Server 2005 Analysis Services
SQL Server 2005 (Yukon) Research

Visual Basic in SQL Server
Retrieve images from SQL Server and store in VB.Net
Developing CLR database objects: 10 tips, 10 minutes
CLR architecture
Creating CLR database objects
CLR assemblies in SQL Server 2005
User-Defined Functions
User-Defined Types
.NET database object security
Debugging CLR database objects
CLR triggers
Visual Basic in SQL Server Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
application server  (SearchSQLServer.com)
Yukon  (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


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

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




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