Web Resources

Answers to Self Review Exercises

20.1

a) SQL. b) rows, columns. c) primary key. d) DataSet. e) DataGridView. f) WHERE. g) ORDER BY. h) joining. i) foreign key. j) System.Data.SqlClient. k) System.Data. l) SqlCommand. m) BindingSource.

20.2

a) False. INSERT and DELETE statements also change the database. Do not confuse the SQL UPDATE statement with the Update method of a TableAdapter. b) False. Multiple rows can have the same value for a foreign key. Providing the same value for the primary key in multiple rows breaks the Rule of Entity Integritydoing so prevents each row from being identified uniquely. c) True. d) True. e) True. f) False. A DELETE statement deletes all rows satisfying the selection criteria in its WHERE clause. g) False. A BindingNavigator allows users to browse and manipulate data displayed by another GUI control. A TableAdapter can Fill a DataSet. h) True.

Exercises

20.3

(DisplayTable Application Modification) Modify the DisplayTable application in Section 20.6 to contain a TextBox and a Button that allow the user to search for specific authors by last name. Include a Label to identify the TextBox. Using the techniques presented in Section 20.8, add a query to the AuthorsTableAdapter that takes a parameter specifying the last name of the author to locate. When the user clicks the Button, the application should execute this query by passing the value entered in the TextBox to the appropriate Fill method of the AuthorsTableAdapter.

20.4

(DisplayQueryResult Application Modification) Modify the DisplayQueryResult application in Section 20.7 to contain a TextBox and a Button that allow the user to perform a search of the book titles in the Titles table of the Books database. Use a Label to identify the TextBox. When the user clicks the Button, the application should execute and display the result of a query that selects all the rows in which the search term entered by the user in the TextBox appears anywhere in the Title column. For example, if the user enters the search term "Visual," the DataGridView should display the rows for Visual Basic 2005 How to Program and Visual C# 2005 How to Program. If the user enters "Systems," the DataGridView should display only the row for Operating Systems. [Hint: Build a query that uses pattern matching with the % wildcard character. SQL supports string concatenation with the + operator, so you can combine '%' with a parameter by placing a + between them.]

20.5

(Baseball Database Application) Build an application that executes a query against the Players table of the Baseball database from Section 20.9. Display the table in a DataGridView, and add a TextBox and Button to allow the user to search for a specific player by last name. Use a Label to identify the TextBox. Clicking the Button should execute the appropriate query.

20.6

(Baseball Database Application Modification) Modify Exercise 20.5 to allow the user to locate players with batting averages in a specific range. Add a TextBoxtxtMinimum for the minimum batting average (0.000 by default) and a TextBoxtxtMaximum for the maximum batting average (1.000 by default). Use a Label to identify the TextBox. Add a Button for executing a query that selects rows from the Players table in which the BattingAverage column is greater than or equal to the specified minimum value and less than or equal to the specified maximum value. [Hint: Use method Decimal.Parse to convert the values of txtMinimum and txtMaximum to Decimal values before passing them to the appropriate Fill method of the PlayersTableAdapter.]

ASP NET 2 0, Web Forms and Web Controls

Preface

Index

    Introduction to Computers, the Internet and Visual C#

    Introduction to the Visual C# 2005 Express Edition IDE

    Introduction to C# Applications

    Introduction to Classes and Objects

    Control Statements: Part 1

    Control Statements: Part 2

    Methods: A Deeper Look

    Arrays

    Classes and Objects: A Deeper Look

    Object-Oriented Programming: Inheritance

    Polymorphism, Interfaces & Operator Overloading

    Exception Handling

    Graphical User Interface Concepts: Part 1

    Graphical User Interface Concepts: Part 2

    Multithreading

    Strings, Characters and Regular Expressions

    Graphics and Multimedia

    Files and Streams

    Extensible Markup Language (XML)

    Database, SQL and ADO.NET

    ASP.NET 2.0, Web Forms and Web Controls

    Web Services

    Networking: Streams-Based Sockets and Datagrams

    Searching and Sorting

    Data Structures

    Generics

    Collections

    Appendix A. Operator Precedence Chart

    Appendix B. Number Systems

    Appendix C. Using the Visual Studio 2005 Debugger

    Appendix D. ASCII Character Set

    Appendix E. Unicode®

    Appendix F. Introduction to XHTML: Part 1

    Appendix G. Introduction to XHTML: Part 2

    Appendix H. HTML/XHTML Special Characters

    Appendix I. HTML/XHTML Colors

    Appendix J. ATM Case Study Code

    Appendix K. UML 2: Additional Diagram Types

    Appendix L. Simple Types

    Index



    Visual C# How to Program
    Visual C# 2005 How to Program (2nd Edition)
    ISBN: 0131525239
    EAN: 2147483647
    Year: 2004
    Pages: 600

    Similar book on Amazon

    Flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net