Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ASP .NET Database Programming Weekend Crash Course - J. Butler, T. Caudill.pdf
Скачиваний:
31
Добавлен:
24.05.2014
Размер:
3.32 Mб
Скачать

A P P E N D I X

A

Answers to Part Reviews

This appendix provides the answers for the Part Review questions.

Friday Evening Review Answers

1.A

2.False. A Web server’s primary responsibility is to handle HTTP requests.

3.False. The two primary protocols for Internet client/server communications are TCP/IP and HTTP.

4.D

5.False. Windows 3.1 is not a supported .NET platform. However, Windows 98, ME, NT, 2000, and XP can run .NET applications. ASP.NET Server Side Applications are, however, limited to 2000 and XP Platforms for development and production.

6.IIS 4.0

7.No. Installing the final release of the .NET SDK over the Beta Releases is not recommended.

8.No. Installing the .NET SDK side by side with your Visual Studio 6.0 or other applications is supported.

9.True. A database in the most general terms can be thought of as a collection of tables. A database can also contain many other objects such as the relationships between tables, stored procedures, triggers, and views.

10.C

11.True

12.False. Database tables are composed of rows and columns.

13.C

14.True. Either Query Analyzer or Enterprise Manager can be used to manage a SQL Server database and its constituent objects.

310

Appendix A

15.B

16.False. SQL Server is a software application, not hardware.

17.False. The T-SQL statement used to create a new database is CREATE DATABASE.

Saturday Morning Review Answers

1.True

2.Create, Retrieve, Update, Delete

3.C. The SQL INSERT statement is used to add data to a table.

4.False. The field value needs be enclosed in single quotes since it is a string. The correct SQL statement is INSERT INTO t_bands (band_title) VALUES (‘Hootie & The Blowfish’).

5.True

6.Hierarchical

7.True. XML is actually a subset of SGML.

8.False. XML was designed to work with any application.

9.False. ASP.NET pages are event-based. When an ASP.Net page is loaded a series of events, including Page_Load, are fired.

10.Events

11.Page_Load, Page_Unload

12.C

13.True. HTML controls maintain their state between client requests by utilizing the hidden “VIEWSTATE” form field.

14.False. HTML controls generate HTML code specific to the requesting browser type.

15.A

16.C

17.False

18.False. Web controls can be bound to many types of data stores including XML, arrays or COM objects.

19.False. ASP.NET Controls can be programmatically added to a page at run-time.

20.C

21.False. ASP.NET User controls have an .ascx file extension.

22.True. You can modularize the design of your application by encapsulating frequently used presentation logic in User controls.

23.False. <html>, <body>, and <form> tags should not be included in User controls. By excluding these HTML tags from User controls, you will be less limited in where you can use the controls.

24.A

Answers to Part Reviews

311

Saturday Afternoon Review Answers

1.False. The required field validator can be used with controls supporting user input.

2.^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})|([a-zA-Z0-9\- \.]+))\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$, which will validate a series of letters or numbers regardless of capitalization, including “_” and “-”, ^([a-zA-Z0-9_\-\.]+), followed by a literal @ character, followed by either an IP address or alternately a domain name using a valid extension such as COM, BIZ, and so on.

3.True. Multiple Validation controls can be used to validate a single control.

4.A

5.A

6.Out-of-process

7.Stores session state out-of-process, allowing you to run your application across multiple servers; Supports request-based load balancing; Provides adequate redundancy, reliability, and uptime when used in conjunction with clustering and hardware or software load balancing; Provides ability to support periodic “code rot” purges; Provides ability to partition an application across multiple worker processes.

8.Stores session state out-of-process, allowing you to run your application across multiple servers; Supports request-based load balancing; Provides extensive redundancy, reliability, and uptime when used in conjunction with clustering and hardware or software load balancing; Provides ability to support periodic “code rot” purges; Provides ability to partition an application across multiple worker processes; Provides ability to partition an application across multiple Web farm machines, Additionally the use of SQL Server provides the use of the Enterprise series of features in terms of memory optimization, clustering, database mirroring, failover and scalability that is less easily achieved using the State Server approach.

9.Authentication

10.Impersonation

11.A

12.<authorization>

13.A

14.C

15.TimeSpan.Zero provides an absolute expiration.

16.When you first insert an object into the cache.

17.False. The Recordset object is a traditional ADO object. .NET uses a series of objects, including DataReader and DataSet objects, to mimic the Recordset object’s functionality.

18.True

19.True. The DataSet object can contain multiple tables, in the form of DataTable objects, as well the relationships between the tables.

312

Appendix A

20.True

21.False. An object is an instance of a class.

22.Object Oriented Programming or OOP

23.True

24.New

Saturday Evening Review Answers

1.D

2.A

3.False. A Connection object, either a SQLConnection or an OLEDBConnection, can be created through a Command object.

4.C

5.True

6.False. The ADO.NET Command objects provide several constructors.

7.C

8.CommandType

9.True. You can only move forward through a DataReader object.

10.OLEDBCommand

11.False. A DataReader can only be created through a Command object.

12.False. You can only move forward through a DataReader object.

13.False. The DataSet object can contain multiple tables, in the form of DataTable objects, as well the relationships between the tables.

14.True.

15.SelectCommand

16.Fill

Sunday Morning Review Answers

1.True. A DataSet can be created explicitly through a variety of constructors.

2.True. A DataSet can contain numerous constituent objects, most notably

DataTable objects.

3.Count

4.Item

5.Data binding

6.True

7.True. Setting a control’s AutoPostBack property to “true” forces the page in which it contained to repost when its state is changed.