11.07.2015 Views

Beginning C# 2008-from Novice-to-professional - A2Z Dotnet

Beginning C# 2008-from Novice-to-professional - A2Z Dotnet

Beginning C# 2008-from Novice-to-professional - A2Z Dotnet

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■CONTENTSxiiiDynamically Loading an Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339Dynamically Instantiating a Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339Enhancing the Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343Loading a Strongly Named Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348Relocating a Strongly Named Assembly <strong>to</strong> the GAC . . . . . . . . . . . . 349Using Version Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351Implementing a Convention-Based Architecture . . . . . . . . . . . . . . . . . . . . 354Dynamically Loading Base Class or Interface Types . . . . . . . . . . . . . . . . . 356The Important Stuff <strong>to</strong> Remember . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357Some Things for You <strong>to</strong> Do. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358■CHAPTER 13 Learning About Multithreading . . . . . . . . . . . . . . . . . . . . . . . . . . . 359Understanding Multitasking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359Preemptive Multitasking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360Time Slicing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360Using Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363Creating a New Thread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363Waiting for the Thread <strong>to</strong> End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364Creating a Thread with State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365Synchronizing Between Threads. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367How Not <strong>to</strong> Deadlock Your Code (Mostly). . . . . . . . . . . . . . . . . . . . . . 372Implementing a Reader/Writer Threaded Architecture . . . . . . . . . . . . . . . 376Implementing a Producer/Consumer Architecture. . . . . . . . . . . . . . . . . . . 380Using a Hidden Producer/Consumer Implementation . . . . . . . . . . . 380Implementing a Generic Producer/Consumer Architecture . . . . . . 382Using an Asynchronous Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . 384The Important Stuff <strong>to</strong> Remember . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386Some Things for You <strong>to</strong> Do. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387■CHAPTER 14 Learning About Relational Database Data . . . . . . . . . . . . . . . 389Understanding Relational Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389Relational Database Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389Database Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391Accessing Relational Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394Designing a Database Using Visual <strong>C#</strong> Express . . . . . . . . . . . . . . . . . . . . . 395Configuring the Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396Adding the Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399Accessing the Database Using ADO.NET. . . . . . . . . . . . . . . . . . . . . . . . . . . 403Connecting <strong>to</strong> a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403Adding Table Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!