Contents he Graphicsltem Class Screen and client coordinates Listening to the mouse and Drawing Graphics Circle objects Invalidation Optimized Drawing Choosing Colors 440 Creating the ColorPalette Control and Sizing the Control 440 Responding to clicks 446 Dealing with Two Colors Indicating the ned Buttons 451 Using Advanced Colors 457 Using the Color Dialog Box 459 Using System Colors Using Different Tools Implementing Hollow Circle 461 Working with Images 466 Drawing Images 467 Scaling Images 469 Preserving the Aspect Rat 471 More Graphics Methods 473 Summary 474 Chapter 15: Accessing Databases 475 What is a database? 475 Microsoft Access Objects 476 Queries 476 The sQL SELECT Statement 477 Queries in 479 Creating a Customer Query 479 Data Access components Data Set 483 Data Gridview nding Source BindingNavigator Table Adapter Data Binding 485 ummary 491 Exercises 492 Exercise 1 Exercise 2
xx Contents The GraphicsItem Class 430 Screen and Client Coordinates 432 Listening to the Mouse and Drawing GraphicsCircle Objects 434 Invalidation 438 Optimized Drawing 439 Choosing Colors 440 Creating the ColorPalette Control and Sizing the Control 440 Responding to Clicks 446 Dealing with Two Colors 449 Indicating the Assigned Buttons 451 Using Advanced Colors 457 Using the Color Dialog Box 459 Using System Colors 460 Using Different Tools 461 Implementing Hollow Circle 461 Working with Images 466 Drawing Images 467 Scaling Images 469 Preserving the Aspect Ratio 471 More Graphics Methods 473 Summary 474 Chapter 15: Accessing Databases 475 What Is a Database? 475 Microsoft Access Objects 476 Tables 476 Queries 476 The SQL SELECT Statement 477 Queries in Access 479 Creating a Customer Query 479 Data Access Components 483 DataSet 483 DataGridView 484 BindingSource 484 BindingNavigator 484 TableAdapter 484 Data Binding 485 Summary 491 Exercises 492 Exercise 1 492 Exercise 2 492 02_574019 ftoc.qxd 9/16/05 9:50 PM Page xx
Conten chapter 16: Database Programming with sQL Server and ado Net 493 ADO. NET 494 ADO. NET Data Namespaces The Sqlconnection Class Working with the Connection String Parameters 495 Opening and Closing the Connection SqlCommand The Connection Property The Command Text Property The Parameters Collection The ExecuteNon Query Method SqlDataAdapter 499 The SelectCommand Property Using Command Builders to Create the Other Commands The Fill Method he data Set Class 504 504 The Sort Property 505 The RowFilter Property The Find Method 506 The ado.neT Classes in Action 507 Examining a Data Set Example 507 How It works Data Binding 515 Binding Context and CurrencyManager 516 Binding Example 518 How It Works: FillDataSetAndView 546 547 Exercise 2 547 Chapter 17: Web Forms 549 Thin-Client Architecture 550 Web forms versus windows forms 551 Web Forms Advantages Web Applications: The Basic Pieces Web Servers
xxi Contents Chapter 16: Database Programming with SQL Server and ADO.NET 493 ADO.NET 494 ADO.NET Data Namespaces 494 The SqlConnection Class 495 Working with the Connection String Parameters 495 Opening and Closing the Connection 497 SqlCommand 497 The Connection Property 497 The CommandText Property 498 The Parameters Collection 498 The ExecuteNonQuery Method 499 SqlDataAdapter 499 The SelectCommand Property 500 Using Command Builders to Create the Other Commands 502 The Fill Method 502 The DataSet Class 504 DataView 504 The Sort Property 505 The RowFilter Property 505 The Find Method 506 The ADO.NET Classes in Action 507 Examining a DataSet Example 507 How It Works 511 Data Binding 515 BindingContext and CurrencyManager 516 Binding Controls 517 Binding Example 518 How It Works: FillDataSetAndView 525 Summary 546 Exercises 547 Exercise 1 547 Exercise 2 547 Chapter 17: Web Forms 549 Thin-Client Architecture 550 Web Forms versus Windows Forms 551 Windows Forms Advantages 551 Web Forms Advantages 551 Web Applications: The Basic Pieces 552 Web Servers 552 Browsers 552 02_574019 ftoc.qxd 9/16/05 9:50 PM Page xxi
Contents Hyper Text Markup Language Script and JavaScript Cascading Style Sheets Active Server Pages Benefits Special Web Site Files 554 Web. config 554 Controls: The Toolbox 554 Building Web Applications 555 Creating a Web Form for Client- and Server-Side Processing Performing Data Entry and validation Designing the Site's Look and Feel How It Works Using the gridview to Build a Data-Driven Web Form 575 Web site locations with vs 2005 582 Exercise Chapter 18: Forms Authentication 585 Web site authentication 585 Windows authentication Forms authentication Web Site Administration Tool (WAT) in controls 595 607 Exercises Exercise 1 608 Exercise 2 609 Chapter 19; Visual Basic 2005 and XML 11 Understanding XML What does xml look like? 612 XML for Visual Basic Newcomers 614 The Address Book Project 15 Creating the project 615 The serializable Data Class oading the XML File 622
xxii Contents HyperText Markup Language 552 VBScript and JavaScript 553 Cascading Style Sheets 553 Active Server Pages 553 Benefits 553 Special Web Site Files 554 Global.asax 554 Web.config 554 Development 554 Controls: The Toolbox 554 Building Web Applications 555 Creating a Web Form for Client- and Server-Side Processing 555 Performing Data Entry and Validation 561 Designing the Site’s Look and Feel 565 How It Works 571 Using the GridView to Build a Data-Driven Web Form 575 Web Site Locations with VS 2005 580 Summary 582 Exercise 583 Chapter 18: Forms Authentication 585 Web Site Authentication 585 Windows Authentication 585 Forms Authentication 586 Web Site Administration Tool (WAT) 586 How It Works 594 Login Controls 595 Summary 607 Exercises 608 Exercise 1 608 Exercise 2 609 Chapter 19: Visual Basic 2005 and XML 611 Understanding XML 611 What Does XML Look Like? 612 XML for Visual Basic Newcomers 614 The Address Book Project 615 Creating the Project 615 The SerializableData Class 616 Loading the XML File 622 02_574019 ftoc.qxd 9/16/05 9:50 PM Page xxii
Conten Changing the Data 625 ending E-mail Creating a List of Addresses 627 Ignoring Members Loading Addresses Adding New Addresses Deleting Addresse 638 Integrating with the Address book Application 640 Demonstrating the Principle of Integration 640 Reading the Address book from Another Appl 647 Exercises 647 Exercise 1 647 Exercise 2 647 Chapter 20: Web Services and. NET Remoting 649 What s a web service? How does a web service work? SOAP 651 Building a Web Service 653 A Web Services Demonstration The picture server service 657 Creating the project Returning Array Returning Complex Information The picture server client Web Services Description Language Creating the Client Adding a Web Reference 670 Displaying the Folder List 671 Displaying the File List and Choosing Files NET Remoting 678 enerating the Proxy Summary Exercise 1 Exercise 2
xxiii Contents Changing the Data 625 Sending E-mail 625 Creating a List of Addresses 627 Ignoring Members 631 Loading Addresses 633 Adding New Addresses 634 Navigating Addresses 636 Deleting Addresses 638 Testing at the Edges 639 Integrating with the Address Book Application 640 Demonstrating the Principle of Integration 640 Reading the Address Book from Another Application 642 Summary 647 Exercises 647 Exercise 1 647 Exercise 2 647 Chapter 20: Web Services and .NET Remoting 649 What Is a Web Service? 649 How Does a Web Service Work? 650 SOAP 651 Building a Web Service 653 A Web Services Demonstration 654 Adding More Methods 656 The Picture Server Service 657 Creating the Project 658 Returning Arrays 660 Returning Complex Information 664 The Picture Server Client 668 Web Services Description Language 668 Creating the Client 668 Adding a Web Reference 670 Displaying the Folder List 671 Displaying the File List and Choosing Files 675 .NET Remoting 678 Generating the Proxy 682 Summary 685 Exercises 686 Exercise 1 686 Exercise 2 686 02_574019 ftoc.qxd 9/16/05 9:50 PM Page xxiii
Contents Chapter 21: Deploying Your Application 6877 What Is Deploy 687 ClickOnce Deployment 688 XCOPY Deployment Creating a visual Studio 2005 Setup Application 693 Creating a Setup application 694 User Interface Editor 697 Deploying Different Solutions 700 Private Assemblies 700 Shared Assemblies 701 Deploying Desktop Applications 702 Deploying XML Web Services 702 Useful tools 702 703 excises 703 Exercise 2 704 Chapter 22: Building Mobile applications 705 Understanding the Environment 705 Common in the Compact Framework he Compact Framework Classes 708 Building a Pocket PC Game 711 ummary 723 Exercise Appendix A: Where To Now? 725 Online resources 726 microsoft resources 726 Other Resources 727 Offline Resources(Books) 727 Professional vb. net. 2nd edition ASPNET 2.0 Beta Preview 728
xxiv Contents Chapter 21: Deploying Your Application 687 What Is Deployment? 687 ClickOnce Deployment 688 XCOPY Deployment 693 Creating a Visual Studio 2005 Setup Application 693 Creating a Setup application 694 User Interface Editor 697 Deploying Different Solutions 700 Private Assemblies 700 Shared Assemblies 701 Deploying Desktop Applications 702 Deploying Web Applications 702 Deploying XML Web Services 702 Useful Tools 702 Summary 703 Exercises 703 Exercise 1 703 Exercise 2 704 Chapter 22: Building Mobile Applications 705 Understanding the Environment 705 Common Language Runtime 706 ActiveSync 706 Common in the Compact Framework 707 The Compact Framework Classes 708 Building a Pocket PC Game 711 Summary 723 Exercise 723 Appendix A: Where To Now? 725 Online Resources 726 P2P.Wrox.com 726 Microsoft Resources 726 Other Resources 727 Offline Resources (Books) 727 Professional VB .NET, 2nd Edition 727 ASP.NET 2.0 Beta Preview 728 02_574019 ftoc.qxd 9/16/05 9:50 PM Page xxiv