Errata

Programming Microsoft® ADO.NET 2.0 Applications: Advanced Topics

Errata for Programming Microsoft® ADO.NET 2.0 Applications: Advanced Topics

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page 6

dt.Rows.AcceptChanges( ) should be dt.AcceptChanges( ) On page 6, in Figure 1-2, the 6th item from the bottom of the page incorrectly states: dt.Rows.AcceptChanges( ) Change: dt.Rows.AcceptChanges( ) To: dt.AcceptChanges( )

Microsoft Press  May 06, 2010 
Printed
Page 128

Sample code for fnGetGuidWhereClause
On page 128, under "Finding All Usages of a GUID in the Database", the source code for "SQL uspGetUsagesForId" refers to a function called fnGetGuidWhereClause, but the code for fnGetGuidWhereClause was inadvertently left out of the sample code. Listed below is the missing code for the function:
CREATE function dbo.fnGetGuidWhereClause
(
@TableName varchar(500),
@Id uniqueidentifier
)
returns varchar(2000)
as
begin

DECLARE @currentColumn varchar(2000)
DECLARE @whereClause varchar(2000)
SET @whereClause = ' '
DECLARE columns_cursor CURSOR
FOR SELECT COLUMN_NAME
FROM information_schema.Columns
WHERE TABLE_NAME = @TableName AND DATA_TYPE='uniqueidentifier'
OPEN columns_cursor
FETCH NEXT FROM columns_cursor INTO @currentColumn
WHILE @@FETCH_STATUS = 0
BEGIN
if(@whereClause) <> ' '
BEGIN
SET @whereClause = @whereClause + ' OR '
END
set @whereClause = @whereClause + @currentColumn + '=''' + convert(varchar(2000),@id) + ''''
FETCH NEXT FROM columns_cursor INTO @currentColumn
END
CLOSE columns_cursor
DEALLOCATE columns_cursor
return @whereClause
end

Microsoft Press is committed to providing informative and accurate
books. All comments and corrections listed above are ready for
inclusion in future printings of this book. If you have a later printing
of this book, it may already contain most or all of the above corrections.The print number of the book is located on the copyright page in the form of a string of numbers. For example: "2 3 4 5 6 7 8 0 QWT 9 8 76 5 4". The first number in the string is the the print number. In this example, the print number is 2.

Microsoft Press  Jul 13, 2010