Skip to main content

Professional C# 2005

Professional C# 2005

Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Allen Jones

ISBN: 978-0-471-75362-9

Dec 2005

1540 pages

Select type: E-Book

Product not available for purchase

Description

Professional C# 2005 prepares you to program in C#, and it provides the necessary background information on how the .NET architecture works. It provides examples of applications that use a variety of related technologies, including database access, dynamic web pages, advanced graphics, and directory access. The only requirement is that you are familiar with at least one other high-level language used on Windows—either C++, VB, or J++.

It starts with a tutorial on C# and the .NET framework. This introduction assumes no prior knowledge of .NET, but it does move rapidly, on the assumption that the reader is an experienced programmer. Once this background knowledge is established, the book starts to sweep through the vast .NET class library, showing how you can use C# to solve various tasks.  This comprehensive coverage is one of the key selling points of previous versions of the book, and is maintained and enhanced with this new edition by adding new chapters on Generics, ObjectSpaces, Yukon, and Indigo. Some reference material is included either as appendices or is available to download from the Wrox website.

After the introduction and initial chapter, the book is divided into a number of sections that cover both the C# language and its application in a variety of areas. Coverage includes:

  • Writing Windows applications and Windows services
  • Writing web pages and web services with ASP.NET
  • Manipulating XML using C# 2005
  • Understanding .NET Assemblies
  • Using ADO.NET to access databases
  • Integration with COM, COM+, and Active Directory
  • Distributed applications with .NET Remoting
  • Generating graphics using C# 2005
  • Accessing files and the Registry, and controlling .NET security
Introduction.

Part I: The C# Language.

Chapter 1: .NET Architecture.

Chapter 2: C# Basics.

Chapter 3: Objects and Types.

Chapter 4: Inheritance.

Chapter 5: Operators and Casts.

Chapter 6: Delegates and Events.

Chapter 7: Memory Management and Pointers.

Chapter 8: Strings and Regular Expressions.

Chapter 9: Collections.

Chapter 10: Generics.

Chapter 11: Reflection.

Chapter 12: Errors and Exceptions.

Chapter 13: Threading.

Part II: The .NET Environment.

Chapter 14: Visual Studio 2005.

Chapter 15: Assemblies.

Chapter 16: .NET Security.

Chapter 17: Localization.

Chapter 18: Deployment.

Part III: Data.

Chapter 19: Data Access with .NET.

Chapter 20: .NET Programming with SQL Server 2005.

Chapter 21: Manipulating XML.

Chapter 22: Working with Active Directory.

Part IV: Windows Applications.

Chapter 23: Windows Forms.

Chapter 24: Viewing .NET Data.

Chapter 25: Graphics with GDI+.

Part V: Web Applications.

Chapter 26: ASP.NET Pages.

Chapter 27: ASP.NET Development.

Part VI: Communication.

Chapter 28: Web Services.

Chapter 29: .NET Remoting.

Chapter 30: Enterprise Services.

Chapter 31: Message Queuing.

Chapter 32: Future of Distributed Programming.

Part VII: Interop.

Chapter 33: COM Interoperability.

Part VIII: Windows Base Services.

Chapter 34: Manipulating Files and the Registry.

Chapter 35: Accessing the Internet.

Chapter 36: Windows Services.

Part IX: Appendices (Web Site Only).

Appendix A: Principles of Object-Oriented Programming.

Appendix B: C# for Visual Basic 6 Developers.

Appendix C: C# for Java Developers.

Appendix D: C# for C++ Developers.

Index.

Code Downloads
Code downloads for this title are available here.
Code from all Chapters except 27 and 28
Download
VB to C# Source Code Listing
Download
Download Code for Chapter 2
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 4
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 6
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 7
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 8
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 9
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 10
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 11
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 12
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 13
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 14
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 15
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 16
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 17
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 18
Download
Download Code for Chapter 19
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 20
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 21
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 22
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 22
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 23
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 24
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 25
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 27
Download
Download Code for Chapter 28
Download
Download Code for Chapter 29
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 30
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 31
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 33
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 34
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 35
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Chapter 36
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Download Code for Appendix A
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
Bonus Chapter: Appendix A - Principles of Object-Oriented Programming
Download the Principles of Object-Oriented Programming bonus chapter in PDF format. To view the file you will need to have Adobe Reader installed.
Download
Bonus Chapter: Appendix B - C# for Visual Basic 6 Developers
Download the C# for Visual Basic 6 Developers bonus chapter in PDF format. To view the file you will need to have Adobe Reader installed.
Download
Bonus Chapter: Appendix C - C# for Java Developers
Download the C# for Java Developers bonus chapter in PDF format. To view the file you will need to have Adobe Reader installed.
Download
Bonus Chapter: Appendix D - C# for C++ Developers
Download the C# for C++ Developers bonus chapter in PDF format. To view the file you will need to have Adobe Reader installed.
Download
Download Code for Chapter 26
The code examples for this title are stored in a ZIP archive. To open it, you will need a computer with software capable of opening ZIP files. If you do not already have this capability, you can download a free trial of WinZip.
Download
ChapterPageDetailsDatePrint Run
Code Replacement / Title Content
The content for this title has been posted and may be accessed via:
http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764575341,descCd-download_code.html
04/28/2006

xxxivError in Code
Second line of code:

using Systm.Collections;
should read as:
using System.Collections;
01/03/06

xxxixError in Code
Page "xxxix", the section on Nullable types:

Code reads:
System.Nullable x = new System.Nullable<int>;

The error reads:
"A new expression requires () or [] after type"

code should read:
System.Nullable x = new System.Nullable();
07/31/06

xlError in Text
First code box

“Minnesota Vikiings”
should be:
“Minnesota Vikings”
3/7/06

xliError in Text
2nd paragraph under “Where C# Fits In”

“simple to understand and didn’t make many programming tasks easy”
should be:
“simple to understand and made many programming tasks easy”
3/7/06

76Error in Code
Code snippet of the first bullet at the bottom of the page:

public int subscriberID;
should read as:
public int subscriberId;

Note the lowercase 'D' of the 'Id'. Also the code snippet of the second bullet on the same page:

public int subscriberID;
should read as:
public int _subscriberId;
1/03/06

76Error in Reference
towards the bottom of the page:
For names of all private member fields in types: public in subscriberId

should say:
For names of all private member fields in types: private in subscriberId
10/16/06

97Text Error
First sentence in last paragraph

It is written,
“… is imaginatively called StaticConstructor”

However, in the following code box, there is no indication that the example is called “StaticConstructor”.

The namespace though ends with .StaticConstructorSample.
3/13/06

98-99Error in Text
All instances of
string model
should be
string description
1/20/06

100Error in Text
Last sentence:
“they cannot be assigned to outside the constructors”

should be:
“they cannot be assigned outside the constructors”
3/13/06

102Error in TExt
Code should read:

public double Diagonal (not public int Diagonal)
01/03/06

107Error in Text
Method table

Public and Protected for GetType() and MemberwiseClone
should be
public and protected (p in lowercase)
01/03/06

107Error in Text
second entry in the table"

"intGetHashTable()"

should be

"intGetHashCode()"
1/17/06

107Error in Text
"int GetHashTable()" at the top of the page should read "int GetHashCode()"
11/17/06

109Text Error
Last paragraph

The last paragraph refers to a BetterMoney object in the code above the paragraph; however, there is nothing in that code referring to BetterMoney.
3/13/06

124Error in Text
Text reads:

Note that type definitions can be public or private, depending on whether you want the type to be visible outside its containing assembly. public class MyClass
{
// etc.
You cannot define types as protected, private, or protected internal, becauseas these visibility levels would be meaningless for a type contained in a namespace. Hence these visibilities can only be applied to members. However, you can define nested types (that is, types contained within other types) with these visibilities, becausesince in this case the type also has the status of a member. Hence the following code is correct

Should read:

Note the type definitions can be internal or public, depending on whether you want the type to be visible outside its containing assembly. public class MyClass
{
// etc.
You cannot define types as protected, private , or protected internal, because as these visibility levels would be meaningless for a type contained in a name space. Hence these visibilities can only be applied to members. However, you can define nested types (that is, types contained within other types) with these visibilities, because since in this case the type also has the status of a member. Hence the following code is correct"
04/27/2006

143Error in Code
int approximatePrice = (int)(price + 0.5);

should be:
int approximatePrice = (int)(price >= 0 ? price + 0.5 : price - 0.5);
05/10/07

150Choice of Wording
First paragraph of section of “Operator Overloading Example: The Vector Struct”

A Vector does not “tell you how far something is moving” it “tells you where something is”

Replace use of the words movement/moving with displacement/(is) displaced
3/15/06

161Error in Code
Code in Main

The testing number should be -50.5 (or -50.35, not -100.00)
The result shown in the shell window is $4294967246.00
1/03/06

163Error in Text
"...(assuming you want the casts to be explicit, which is usually the case when defining casts between user-defined casts): "

should be:

"...(assuming you want the casts to be explicit, which is usually the case when defining casts between user-defined classes): "
07/25/2007

166Error in code
double amountD = (double)(float)balance;
With the explicit cast and the data set to 50.35 (not 10.50), the result is 50.3499984741211.
Without the explict cast, I got 50.35. That means:

double amountD = (double)(float)balance;
and
double amountD = balance;
don't do exactly the same thing
01/03/06

187Error in Code
At the bottom, it has code for doing an anonymous instantiation of an EventHandler object, like this:

btnOne.Click += new EventHandler(lblInfo.Text = "Button One was pressed";);

This code won't compile. Possibly it has to be something like this, which does compile:

btnOne.Click += new EventHandler(delegate(object o, EventArgs e) {lblInfo.Text = "Button One was pressed";});
04/28/2006

208Error in Figure
Figure 7-5:
pY=012F8C4

Should be:
pY=0x12F8C4
04/19/07

209Error in Code
int* pointerToInt;
void* pointerToVoid;
pointerToVoid = (void*)pointerToInt;

should be:

int x = 32;
int* pointerToInt = &x;
void* pointerToVoid;
pointerToVoid = (void*)pointerToInt;
05/16/07

238Typos
were
should be:
where

AND

regular collections
should be:
regular expressions

AND

to only contain
should be:
to contain only
05/16/07

240Error in Expression
The regular expression [0-9]+ only matches /positive/ integers. If it is to match /all/ integers, as claimed, then it must be changed to -?[0-9]+ so that it also matches negative integers. If not, then the claim needs to be weakened from "integer" to "natural number".
05/23/07

240Errors in Reference
The section "Displaying Results":
second paragraph: refers to "input text quoted earlier" that wasn't quoted in the book, but appears in the downloadable code for Chapter 8 (RegularExpressionsPlayaround.cs).

AND

bottom line: refers to a property "Value", but the code uses "ToString()" instead.
05/23/07

241Error in Code
The "Find2()" code shown on p.241 differs in both "text" and "pattern" from the "Find2()" method in the downloadable code.

AND

The "Find1()" method was not, as claimed, shown previously in the book, but it does appear in the downloadable code.

AND

The output shown in text differs from that obtained by running the downloadable code.
05/23/07

248Error in Text
fist line in the topic "Adding collection support..."

"The Vector struct started in Chapter 3..."

should be

"The Vector struct started in Chapter 5..."
1/17/06

259, 261Error in Code
EmployeeData theEmployee = employees[id];

should be:
EmployeeData theEmployee = (EmployeeData)employees[id];
05/21/07

9263Error in Concept and Code
In the first sentence, last paragraph:

“The smaller the maximum load, the more efficiently your hashtable works…”
Usually the efficiency of a Key depends on how it loads in relation to how the algorithm expects. You can plan a balanced or skewed loading which will have and effect on what the Load should be. AND Hashtable employees = new Hashtable(50, 0.5); should be: Hashtable employees = new Hashtable(53, 0.5F);"
03/23/2006

264Outdated information
Please disregard statement:
"or you might try to retrieve an entry and get the wrong entry returned"
05/21/07

288Error in Figure 10-3
Figure 10-3:

List<LinkedListNode<Documents>
Should read:
List<LinkedListNode<Document>>

AND

LinkedList<Documents>
should read:
LinkedList<Document>
1/12/06

10294Unexplained Class Definition
In the last sentence of the second paragraph of Constraints:
ProcessDocuments appears without explanation. Up to this point, it is not insinuated that a Generic Class could have two or more Types in its definition.
03/23/2006

296Code Error
T doc =
documentManager.GetDocument();

should read:

TDocument doc =
documentManager.GetDocument();
1/12/06

10303Error in Text/Code
Last sentence, second paragraph of ArraySegment:
Last element:
6
should be: 5


AND

In the Code Box:
Assuming "count" is the number of elements in the Segment, the "for" Statement should be one of the following:

(a) for (int i = segment.Offset; i < segment.Offset + segment.Count + 1; i++)
(b) for (int i = segment.Offset; i <= segment.Offset + segment.Count; i++)
03/23/2006

321-322Error in Text/Code
1. In Main():
the "return;" after "AddToMessage(\"This assembly does not support WhatsNew attributes\");" should be removed, as this would cause the program to exit immediately, without displaying this error-message.

SO

2. To accommodate the above change, the code on p.322 following the else-statement needs to be in curly brackets as follows:
else
{
AddToMessage("Defined Types:");

Type[] types = theAssembly.GetTypes();
foreach (Type definedType in types)
DisplayTypeInfo(theAssembly, definedType);
}
05/25/07

321Error in Code
Rather than hard-wiring backDateTo into the code, it should be input by the user:
for example, by expanding the code from 2.(previous errata) as follows:
else
{
while (true)
{
Console.Write("Enter date: ");
try
{
backDateTo = DateTime.Parse(Console.ReadLine());
break;
}
catch (FormatException fe)
{
Console.WriteLine("Input not recognised as a valid date - please try again.");
}
}
AddToMessage("Defined Types:");

Type[] types = theAssembly.GetTypes();
foreach (Type definedType in types)
DisplayTypeInfo(theAssembly, definedType);
}
05/25/07

322Error in Method
AddToMessage(nextMethod.ReturnType + " " + nextMethod.Name + "()");
should be:
AddToMessage(nextMethod.Name);

...because it displays all methods as though they took no parameters, which is not the case! So if we're not going to bother displaying the method-signatures properly, it would be better to display just the method-names to avoid implying that the signatures currently displayed are correct and complete.
05/25/07

328Missing Word
very similar using exceptions

should be:
very similar to using exceptions
05/22/07

329Typos
box that reads: 10Exception

should be: I0Exception
(the "1" should be changed to an "I")

AND

Figure 12-1:
ArgumentExeption

should be:
ArgumentException
1/17/06, 5/22/07

335Error in Text
Bottom line:
and ending with the most general options.

should be:
and the lowermost catch block should be the most general option.
(where "catch" is in the fixed-width font)
05/22/07

343Errors in Chapter Reference
The "principles laid down for the disposing of objects" are in Chapter 7 -not Chapter 4 as stated in the first paragraph of "Throwing the user-defined exceptions".

AND

File-handling is discussed in depth in Chapter 34 - not Chapter 35 as stated here.
05/22/07

356Missing Code
after the end of the Main() method (before the last curly bracket):
this section should be added to the code:

/*
More…
*/
05/29/07

401Error in Text
first bulleted paragraph under Extra source code debugging commands:
unless it is explicitly #undefined in the source code.

should read:
unless it is explicity undefined using the #undefine compiler directive in the source code.
(because there is no #undefined directive.)
05/29/07

407Error in Figure Reference
Under Figure 14-27, second sentence:
"For example, in Figure 14-24..."

should read:
"For example, in Figure 14-27..."
05/29/07

415Incorrect Figure
Figure 15-2 is wrong. The output of the console should say:
Main in domain AssemblyA.exe called
1/20/06

447Error in Text
2nd line from bottom reads:
Pay attention to the use of uppercase P!

2nd line from bottom should read:
Pay attention to the use of uppercase T!
11/03/06

459Error in Text
In the paragraph between the two grey boxes:
<supportedVersion>

should be:
<supportedRuntime>
05/25/07

472Error in Text
final paragraph before 3 bullets:
The text reads:
Another set of permissions is asigned by the CLR on the basis of the identity of the code, which cannot be granted.

should be:
Another set of permissions is asigned by the CLR on the basis of the identity of the code.

The phrase "which cannot be granted" should be deleted.
10/10/06

490Error in Text
"13. In the Properties window, located the...."

"located" should be "locate"
12/22/05

16Chapter 16 Password Request
The files provided in WROX software packaging are supposed to be used per instructions associated to them from the book. If you are required to open this file separately per instructions in the book, the password will be provided. If not then it may be just an accessory to the rest of the packaging for chapter 16. For further inquiries, you may visit the WROX forum for this title at the following and submit your request http://p2p.wrox.com/forum.asp?FORUM_ID=221
05/10/2006

17528Error in Text
Last word of second line reads:
Image.ToFile

Should Be:
Image.FromFile
06/26/2006

541Error in Text
in the Box on the page for the translations under the name column, the names should have an underscore added ie: Good Morning should be Good_Morning - similarly this should be done for Good Afternoon and Good Evening.
1/17/06

575Missing reference
last sentence:
"MDAC" should be described as 'Microsoft Data Access Components' with reference to its context (SQL Server databases).
11/28/06

584Error in Code
At the bottom of the page, reads:
ConfigurationSettings.ConnectionStrings[name];
should be:
ConfigurationManager.ConnectionStrings[name];
12/09/05

596Error in Text
The first sentence under "Record insertion":
The Region table only consists of..."

should read:
"The Region table consists only of..."
05/29/07

600Typos (2)
paragraph before "Managing Data ...":
"... which unitl this was tested under the release version of .NET it was."

should be:
"... which until this was tested under the release version of .NET was."
05/29/07

601Table column identifier mistake
The title above the Data Column in figure 19-4 DataRow
should be:
DataColumn.
2/21/06

611Error in Text
"There are six different constructors for the ForeignKeyConstraing class - I would suggest using those that permit you to name the constraint".
2/21/06

630Error in Text
("Conventions for constraints": third point)

"length of the constraint"

should be:

"length of the constraint-name"
02/06/2008

635Error in Text
Table: SqlContext:

"WindowsIdentitiy"

should be:

"WindowsIdentity"
02/08/2008

635Error in Text
Table: SqlPipe:

"to either send a SqlDataReader, SqlDataRecord, and string"

should be:

"to send either an SqlDataReader, an SqlDataRecord or a string"
02/08/2008

650Error in Text
When opening the reader, there is a space where it shouldn't be: (CommandBehavior.Close Connection);
2/13/06

651Error in Text
"Events table"

should be:

"Exams table"
02/19/2008

651Error in Code
('70-315,
should be:
Exam values('70-315'...

ALSO

(70-316,
should be:
('70-316'

ALSO

<Exam
should be:
'<Exam
^this appears twice on 651
02/19/2008

652Error in Code
('70-320,
should be:
('70-320',

ALSO

<Exam
should be:
'<Exam
02/19/2008

655Error in Code
SET Info.modify('delete /Exam[1]/Course[5])

should be:

SET Info.modify('delete /Exam[1]/Course[5]')

ALSO

SET Info.modify('replace value of
/Exam/Course[text() = 2310]/text()[1] with
2644'
FROM Events

should be:

SET Info.modify('replace value of
(/Exam/Course[text() = 2310]/text())[1] with
2644')
FROM Exams

ALSO

(second paragraph under "XML Indexes") --

"idx_events on the Event column"

should be:

"idx_exams on the Info column"
02/19/2008

655Error in Code
SET Info.modify('delete /Exam[1]/Course[5])

should be:

SET Info.modify('delete /Exam[1]/Course[5]')
02/19/2008

656Error in Code
WHERE
Info.exists('//Certification[@Name="MCAD"]') = 1

should be:

WHERE
Info.exist('//Certification[@Name="MCAD"]') = 1
02/19/2008

21667Error in Text
In manipulating XML

The ReadValueAs methods should all be changed to ReadElementContentAs. There are the 5 instances in this section and there is one more reference in the section on XPathNavigator.
05/09/2006

673Error in Text
math

should be:

match
02/20/2008

673 - 677Error in Code
The code-boxes on pp. 673 and 675-677 are inconsistent as to whether the XmlDocument variable is called "doc" or "_doc": it's called "doc" in most places, but my recommendation is to stick to the convention of using an underscore for a private member-field.

_doc should be changed to doc
02/20/2008

678Error in Code
(paragraph under code-box)--
xml
should be:
XML

ALSO

("Using XPathNavigators)--
(a) "XPathNavigaor"
should be:
"XPathNavigator"

(b) "xml"
should be
"XML"
02/20/2008

679Error in Text
("XPathDocument")--

(a) "other then" -> "other than"
(b) "xml" -> "XML" (twice)
(c) "Stream based" -> "Stream-based"
(d) "ti" -> "to"
(e) "the use" -> "then use"
02/20/2008

680Error in Text
(paragraph above "XPathNodeIterator"

(a) "form the nods" -> "from the nodes"

(b) "XmReader" -> "XmlReader"
02/20/2008

680/681Errors in List
(list on pp.680/681)--

(b) "Clone" should be moved from the start of the list to after "CurrentPosition" and before "MoveNext", and changed to "Clone()", because it is a method rather than a property.

(c) "CurrentPosition()" SHOULD BE "CurrentPosition", because it is a property rather than a method.
02/20/2008

681Error in Text
Change the file booksxpath.xml to
"XPathDocument doc = new
XPathDocument("books.xml");"
1/20/06

681Style Clarification
(a) "the XPathNavigators select methods"

XPathNavigator (without s) should be code style, and the s should be normal text
02/20/2008

686Error in Text
In text

"BookUtils"
Should be:
"BookItils"
2/13/06

758Error in Text
In hierarchy:

System.Windows.Form.UpDown
Should be:
System.Windows.Form.UpdDown

and

DataGridView
Should be:
DateGridView
2/13/06

23766Error in Text
In the 3rd paragraph "SelectValue" should read "SelectedValue"

AND

In the 3rd code snippet "SelectValue" should read "SelectedValue"
05/01/2006

774Error in Text
Paragraph 2:

constructor
Should be:
constrictor
2/13/06

777Error in Text
The first two items in the list

should be:

The last two items in the list
06/25/2007

783Error in Text
second paragraph, line 7:

"For this example, you need to phone number."

should be:

"For this example, you need the phone number."
08/14/2007

23786EnableVisualSyles method availability
First paragraph. last sentence:

"Also, EnableVisualStyles is available only in .NET framework 1.1."

This is incorrect, EnableVisualStyles method is available in .NET 2.0 as well as .NET 1.1, but not .NET 1.0.

From MSDN documentation:
"Application.EnableVisualStyles Method
...
Version Information
.NET Framework
Supported in: 2.0, 1.1"
2/28/06

809Error in Text
DataGridView
Should be:
DataGrid control
08/25/06

835Error in Code
The lower code-box on p.835 does not (textually) match the code on p.833, which makes it difficult to find in the source-code I've typed in. Specifically, the first three lines should be replaced with...

ContextMenuAttribute[] ctx = ContextMenuAttribute[])
meth.GetCustomAttributes(typeof(ContextMenuAttribute), true);

...if the code on p.833 is to be the definitive version.
02/19/2008

835Error in Code
The lower code-box on p.835 does not (textually) match the code on p.833, which makes it difficult to find in the source-code I've typed in. Specifically, the first three lines should be replaced with...

ContextMenuAttribute[] ctx = ContextMenuAttribute[])
meth.GetCustomAttributes(typeof(ContextMenuAttribute), true);

...if the code on p.833 is to be the definitive version.
02/19/2008

837Error in Code
The second code-box on p.837 is missing the line...

public bool Default;

...which should be inserted under the existing line:

public readonly string Caption;
02/19/2008

839Clarification
'DataSet and DataMember are Customers.'

should be:

DataSource in this instance refers to a DataSet, and DataMember is set to "Customers".
02/19/2008

840Error in Text
'includes large number'

should be:

'includes a large number'
02/19/2008

311111Error in Text
Last paragraph, before code, reads:

"This class just has a one property...";
Should read:
"This class just has one property..."
6/26/06

1240Error in Text
"...it can make accomplishing some specific Internet access tasks easier for you to accomplish."

should be:

"...it can make accomplishing some specific Internet access tasks easier for you."
07/11/2007

16Obsolete Code
The application for chapter 16 of Professional C# 2005 called SimpleExample has a line of obsolete code in the download that will cause it to not compile. This code is in the file called Program.cs and reads as "Application.EnableRTLMirroring();". Leaving this line of code in the application will result in a compile error.

By taking this line out of the code, the application will run without any issues as it will load the data from animal.txt as shown in the book.
12/13/2007