Skip to main content

Professional C# 2008

Professional C# 2008

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

ISBN: 978-1-118-05946-3

Jan 2011

1848 pages

Select type: E-Book

Product not available for purchase

Description

Professional C# 2008 starts by reviewing the overall architecture of .NET in Chapter 1 in order to give you the background you need to be able to write managed code. After that the book is divided into a number of sections that cover both the C# language and its application in a variety of areas.

Acknowledgments xiii

Introduction xlvii

Part I: The C# Language 1

Chapter 1: .NET Architecture 3

Chapter 2: C# Basics 25

Chapter 3: Objects and Types 75

Chapter 4: Inheritance 101

Chapter 5: Arrays 121

Chapter 6: Operators and Casts 141

Chapter 7: Delegates and Events 177

Chapter 8: Strings and Regular Expressions 203

Chapter 9: Generics 223

Chapter 10: Collections 247

Chapter 11: Language Integrated Query 297

Chapter 12: Memory Management and Pointers 329

Chapter 13: Reflection 357

Chapter 14: Errors and Exceptions 377

Part II: Visual Studio 399

Chapter 15: Visual Studio 2008 401

Chapter 16: Deployment 443

Part III: Base Class Libraries 467

Chapter 17: Assemblies 469

Chapter 18: Tracing and Events 509

Chapter 19: Threading and Synchronization 533

Chapter 20: Security 583

Chapter 21: Localization 639

Chapter 22: Transactions 679

Chapter 23: Windows Services 715

Chapter 24: Interoperability 749

Part IV: Data 789

Chapter 25: Manipulating Files and the Registry 791

Chapter 26: Data Access 845

Chapter 27: LINQ to SQL 895

Chapter 28: Manipulating XML 921

Chapter 29: LINQ to XML 967

Chapter 30: .NET Programming with SQL Server 985

Part V: Presentation 1015

Chapter 31: Windows Forms 1017

Chapter 32: Data Binding 1061

Chapter 33: Graphics with GDI+ 1093

Chapter 34: Windows Presentation Foundation 1149

Chapter 35: Advanced WPF 1199

Chapter 37: ASP.NET Pages 1273

Chapter 38: ASP.NET Development 1311

Chapter 39: ASP.NET AJAX 1355

Chapter 40: Visual Studio Tools for Office 1385

Part VI: Communication 1421

Chapter 41: Accessing the Internet 1423

Chapter 42: Windows Communication Foundation 1455

Chapter 43: Windows Workflow Foundation 1487

Chapter 44: Enterprise Services 1527

Chapter 45: Message Queuing 1555

Chapter 46: Directory Services 1587

Chapter 47: Peer-to-Peer Networking 1625

Chapter 48: Syndication 1643

Part VII: Appendices 1653

Appendix A: ADO.NET Entity Framework 1655

Appendix B: C#, Visual Basic, and C++/CLI 1681

Summary 1729

Index 1731

README FIRST
Download
Chapter 1 - No code
Chapter 2
Download
Chapter 3
Download
Chapter 4
Download
Chapter 5
Download
Chapter 6
Download
Chapter 7
Download
Chapter 8
Download
Chapter 9
Download
Chapter 10
Download
Chapter 11
Download
Chapter 12
Download
Chapter 13
Download
Chapter 14
Download
Chapter 15 - No code
Download
Chapter 16
Download
Chapter 17
Download
Chapter 18
Download
Chapter 19
Download
Chapter 20
Download
Chapter 21
Download
Chapter 22
Download
Chapter 23
Download
Chapter 24
Download
Chapter 25
Download
Chapter 26
Download
Chapter 27
Download
Chapter 28
Download
Chapter 29
Download
Chapter 30
Download
Chapter 31
Download
Chapter 32
Download
Chapter 33
Download
Chapter 34
Download
Chapter 35
Download
Chapter 36
Download
Chapter 37
Download
Chapter 38
Download
Chapter 39
Download
Chapter 40
Download
Chapter 41
Download
Chapter 42
Download
Chapter 43
Download
Chapter 44
Download
Chapter 45
Download
Chapter 46
Download
Chapter 47
Download
Chapter 48
Download
Appendix A - No code
Appendix B
Download
Appendix C
Download
All Code for Book
Download
Chapter 30 Database
Database file first referenced on page 986.
Download
Missing Database Files for Chapter 22
CourseManagementDatabase.zip
Download
Additional Downloadable Code
This is a missing piece of downloadable code. It is a database file referenced first on page 986.
Download
ChapterPageDetailsDatePrint Run
livErrors in Reference
2nd row from top:
Visual Studio 2005

should be:
Visual Studio 2008

AND

4th row from top:
Framework 2.0 or 3.0

should be:
Framework 2.0, 3.0 or 3.5
08/11/08

L (50 in Intro)Error in Text
Page L of the introduction referencing automatically implemented properties supplies the fully expanded example using myItem.

The field declaration is a private int _myItem, while the property accessor and mutator refer to myItem (no underscore). They should be:

private int myItem;
12/3/09

7Error in Text
knowSuggested

should be:

knownLine
07/10/2008

226Error in Reference
Reference is made to an online document here:

We have also made available separate documents for download on the Wrox Press Web site (www.wrox.com) that give introductions to C# from the point of view of each of these languages. Should be: We have made introductions to C# from the point of view of each of these languages available in Appendix B.
04/03/08

31Error in Text
Under "The output from this program is," on the third line:

System.Bool

Should be

System.Boolean
02/06/09

33Errore in Code
The Console.WriteLine() statement should not be outside of a method.
04/01/08

42Error in Text
Near the bottom of the page,

... to Visual Basic EndIf...

Should be

... to Visual Basic End If...

(missing space)
4/1/10

243Error in Code
In the second code listing:

if (i == 0) Let's add some brackets here.

The "Let's add some brackets here." comment should not be there. Should be:

if (i == 0)
4/10/09

66, 67Error in Text
On pages 66 and 67, there are reserved keyboards listed. Private and Public are both capitalized, which should be lowercase. Any C# keyword should be lowercase.
4/5/10

269Error in Text
public int subscriberId;

Should be

private int subscriberId;
7/8/09

88Error in Code
The paragraph at the bottom of the page has two errors:

System.Drawing.Color.DateTime

should read:

System.DateTime

and:

System.DRawing.dll

should read:

System.Drawing
1/26/09

112Error in Table
The table should read:

internal Any types or members
private Any member of a type, also any nested type
08/13/08

4119Error in Code
if ((result == Withdraw(amount))

should read:
if (result = Withdraw(amount))
07/07/2008

126Error in Code
row: 2, element: 1, value: 9
row: 2, element: 2, value: 10
row: 2, element: 3, value: 11

Should be:
row: 2, element: 0, value: 9
row: 2, element: 1, value: 10
row: 2, element: 2, value: 11
06/16/2010

129Error in Text
The Array class implements a bubble-sort for sorting the elements

Should be

The Array class implements a quick-sort algorithm for sorting the elements
03/27/09

142Error in Table
Line 6 of the table

Comparison == != < ><= >=

should be

Comparison == != < > <= >= (space between > and <=)
5/26/09

148Error in Table
In line 5 of the table:

Group Operators

can be removed, is same as header
5/26/09

7192Error in Code
bottom line:

list.FindAll(int x) => { return x>5; });

Should be:

list.FindAll((int x) => { return x>5; });
07/09/2008

148Error in Table
In line 8 of table:

Relational < ><= >= is as

should be

Relational < > <= >= is as (space between > and <=)
5/26/09

163Error in Table
In line 5 of the table:

Comparison ==, !=,>=,<=>,<,

should be

Comparison ==, !=, >=, <=, >, < (comma between <= and >; the last comma can be removed; add space for readability)
5/26/09

197Typo in Text
Before the last code:

The code for the events would like this:

should be

The code for the events would be like this:
6/15/09

198Error in Code
"public ActionCancelEventArgs(bool cancel) : this(false, String.Empty) {}"

should be:

"public ActionCancelEventArgs(bool cancel) : this(cancel, String.Empty)
07/08/2008

200Error in Text
First paragraph:

set the string to :: and cancel the event

should be

set the string to " and cancel the event
6/15/09

212-214Error in Code
On page 214, the routine Norm() should look like this:

public double Norm()

{

return Math.Sqrt(x*x + y*y + z*z);

}
1/26/09

10260Error in Text
else
return res;

?res? should be changed to ?result?
07/09/2008

271Error in Figure 10-4
Figure 10-4 should have:

List<LinkedListNode<Document>> for the list on the left column and

LinkedList<Document> for the linked list on the right column
6/29/09

274Error in Text
After this line of code:

firstPriorityNode = priorityNode.Previous;

The following line should be added:

priorityNode = firstPriorityNode;
1/11/10

315Error in Text
List for the grouping query on page 315 is incorrect.

List should be:

UK 9
Brazil 3
Finland 3
Australia 2
Austria 2
Italy 2
USA 2
1/25/10

10316Error in Results
Lewis Hamilton should be removed from the results on bottom of page 316, Kimi Raikkonen should be added to the Finland-results.

Here are the correct results:

UK 8
Jim Clark; Mike Hawthorn; Graham Hill; Damon Hill; James Hunt; Nigel Mansell; Jackie Stewart; John Surtees;
Brazil 3
Emerson Fittipaldi; Nelson Piquet; Ayrton Senna;
Finland 3
Mika Hakkinen; Kimi Raikkonen; Keke Rosberg;
Australia 2
Jack Brabham; Alan Jones;
Austria 2
Niki Lauda; Jochen Rindt;
Italy 2
Alberto Ascari; Nino Farina;
USA 2
Mario Andretti; Phil Hill;
07/09/2008

537Error in Text
Underneath the heading Asynchronous Callback, the third sentence ends with: "defines a parameter of IAsnycResult and a void..."

IAsnycResult

should be

IAsyncResult
1/25/10

563Error in Code
The code in the Main() function at the bottom of page 563 contains a undefined local variable, mevents, which should be autoEvents.
7/10/09

573Error in Text
In the paragraph before the last code segment on the page:

After sleeping, the result of the calculation is written to the Result property of DoEventArgs.

The last word in the sentence should be

DoWorkEventArgs
7/9/09

898Error in Text
2nd paragraph:

To start this task, right-click your solution,...

Should be

To start this task, right-click your project,...
03/10/09

925Error in Text
In final paragraph of page 925, the sentence starting with “Notice that this example uses FileStreams, ..." should be ignored.
1/12/10

28933Error in First Code Block
First code block:
//change path to math your path structure

should be:
//change path to match your path structure
06/11/08

933Error in Second Code Block
Second code block:

math

should be:
match
06/12/2008

1459Error in Code
data.RoomReservations.Add(roomReservation);

Should be:

data.RoomReservations.InsertOnSubmit(roomReservation);
8/10/09

1697Error in Text
section ?foreach Statement?:

Remove the last sentence ?The For Each statement of Visual Basic doesn?t allow??

The new Visual Basic code:

For Each num as Integer In arr
Console.WriteLine(num)
Next
07/24/08

Additional Text for pg 319

Additional text for pg 319:

The Racer class needs to override GetHashCode and Equals for this code sample, so the racersByCar delegates return the same object instances by querying for Ferrari and McLaren.