Home Tab Browse Books Tab For Instructors Tab Email Newsletter Tab About Sybex Tab Contact Us Tab  
sybex.com
Cover image for product 0782128785
Mastering Visual Basic.NET Database Programming
Evangelos Petroutsos, Asli Bilgin
ISBN: 978-0-7821-2878-9
Paperback
704 pages
March 2002
This title is out-of-print and not currently available for purchase from this site.
 
Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.
ChapterPageDetailsDatePrint Run
Combined Errata

Page 0CD

Some filenames are truncated.

All Source Code
2878Src.zip
2.72MB

7 278-281 Code for chapter 7: Northwind System

Code for chapter 7: Northwind System

Method SeekUsingCountry has been updated. The old code can be found in the method LegacySeekUsingCountry.

Errata Title: Invalid Cast Error using Select method of DataTable with typed DataRow array

Problem
The release version of VS .NET introduced a new bug that gives you an invalid cast exception when you try to set the Select method to a typed DataRow array. The Select() method generates an Invalid Cast error when used with an array of typed DataRows.

Resolution
Microsoft confirmed that this is a bug. They said this will be fixed in the service pack 1 for Visual Studio .NET. There was no hot fix available at the time of this publication.

Reason for problem
The Select method of the DataTable was updated to leverage any existing indexes. This new feature can improve performance thirty-fold. This new feature was introduced shortly prior to ship data, causing support for the typed DataRow in the Select() method to fail.

Workaround
Use generic DataRow array. You can filter using the Select() statement, and still take advantage of strong typing. To do this, I am forcing a cast on the DataRow in the generic DataRow array to the typed DataRow, as I loop through it – that way I can use strong typing.

Text Updates
The text discusses how you can take advantage of typed DataTables using the Select() statement. Now that this is no longer supported, the code is updated to reflect the workaround.

Jan. 24th, 2006