Cover image for Beginning ASP.NET 2.0 databases : beta preview
Title:
Beginning ASP.NET 2.0 databases : beta preview
Personal Author:
Publication Information:
Indianapolis, IN : Wiley Publishing, 2005
ISBN:
9780764570810
Added Author:

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000010125905 TK5105.888 K38 2005 Open Access Book Book
Searching...

On Order

Summary

Summary

What is this book about?

With help from Microsoft ASP.NET insider Bradley Millington, John Kaufman covers both VB.NET and C# coding for ASP.NET databases so you don't have to decide up front which language you want more and retailers no longer have to manage inventory on separate language versions.

What does this book cover?

This edition is completely written from scratch on the ASP.NET "Whidbey" Beta to ensure the coverage is most appropriate for this greatly changed version.

The book focuses on solving business problems in a logical progression, from connecting to displaying to changing the data. Additional chapters cover enhancements to the presentation and alternate types of data. The book follows the practice of going beyond the basic techniques to discuss the permutations, pitfalls, and best practices that occur in real business scenarios.


Author Notes

John Kauffman has written numerous books about ASP and the incorporation of data into ASP pages. Born in Philadelphia and educated at Penn State, he has lived, taught, and programmed on three continents as he follows his wife's diplomatic assignments.
When not writing, he spends his time sailing, teaching electronics to high school groups, and chauffeuring his kids to hockey and music practices.


Table of Contents

Forewordp. xvii
Introductionp. xxi
Chapter 1 Introduction to ASP.NET 2.0 and ADO.NETp. 1
Overview of the Technologiesp. 2
Introduction to the .NET Frameworkp. 2
Introduction to ASP.NETp. 4
Introduction to ASP.NET 2.0p. 5
Introduction to ADO.NETp. 7
ASP.NET 2.0 and Data Accessp. 8
Review of Terminologyp. 9
Setup Requirements for This Bookp. 11
Install a Web Serverp. 12
Install the .NET Framework Version 2.0p. 12
Install an Editor to Create Web Pagesp. 13
Visual Studiop. 13
Visual Web Developer Expressp. 13
Notepad and Other Editorsp. 14
Install a Database Management Systemp. 14
Microsoft Accessp. 15
Microsoft SQL Serverp. 15
Other Relational Databasesp. 15
SQL Server Expressp. 15
Setupp. 16
Install the Sample Databasesp. 17
Demonstrationsp. 18
Summaryp. 27
Exercisesp. 28
Chapter 2 Connecting to an Access Databasep. 29
Microsoft Access and the JET Database Enginep. 30
Connecting to a Microsoft Access Database in Visual Web Developerp. 30
The AccessDataSource Controlp. 33
Variations in Select Statementsp. 36
Variations in MDB File Locationp. 40
Handling File Permissionsp. 41
Handling Access Connection Failuresp. 42
A Few Notes on Using Access in Web Applicationsp. 45
Common Mistakes with AccessDataSource Controlsp. 46
Summaryp. 47
Exercisesp. 48
Chapter 3 Connecting to SQL Server and SQL Server Expressp. 49
Introduction to SQL Server and Connection Stringsp. 50
Preparing to Use a SQL Server Databasep. 51
Connection Stringsp. 51
Using the SqlDataSource Controlp. 53
Understanding Security in SQL Serverp. 57
Storing the Connection String in the Web.Config Filep. 59
Discovering the Structure of an Unfamiliar Databasep. 64
Handling Connection Failures with the SqlDataSourcep. 66
Common Mistakesp. 69
Summaryp. 69
Exercisesp. 71
Chapter 4 Connecting to Other Relational Databasesp. 73
Introduction to Connections with Providersp. 73
Relationship between Layers of Connectivity Softwarep. 74
Supported ADO.NET Providersp. 75
Using Providers in ASP.NET 2.0p. 76
Connecting to Access When a Password Is Usedp. 78
Connecting to an MDB with a Security Schemep. 79
Connecting to Oraclep. 83
Theory and Syntaxp. 83
Connecting to MySQLp. 84
Theory of a Connection to MySQLp. 84
Syntax for an ODBC Connection to MySQLp. 84
Connecting to Other Databasesp. 86
Common Mistakesp. 87
Summaryp. 87
Exercisesp. 88
Chapter 5 Displaying Data in Tablesp. 89
Displaying Data in ASP.NET 2.0p. 90
Review of Data-Bound and Data Source Controlsp. 90
Types of Data-Bound Controlsp. 90
Introduction to the GridView Controlp. 91
Capabilities of the GridView Controlp. 91
GridView Rendering Elementsp. 92
Connecting a GridView to Datap. 92
Drag and Drop Fields from Data Explorerp. 93
Drag and Drop Controls from Toolboxp. 93
Customizing the GridView's Columnsp. 95
Selecting Columns in the Edit Columns Dialogp. 95
Types of Column Fieldsp. 96
Bound Fieldp. 96
CheckBox Fieldp. 97
HyperLink Fieldp. 99
Image Fieldp. 102
Command Fieldp. 102
Button Fieldp. 104
Template Fieldp. 107
AutoGenerateColumns Property of the GridViewp. 110
Handling Null Field Valuesp. 111
The DetailsView Controlp. 112
DetailsView Rendering Elementsp. 112
Connecting the DetailsView to Datap. 113
Common Mistakesp. 115
Summaryp. 115
Chapter 6 Customizing the Appearance of Tablesp. 117
Customizing Appearancep. 118
BackColor and BackImageUrlp. 118
Font and ForeColorp. 119
Height and Widthp. 119
CellSpacing and CellPaddingp. 120
Borders and GridLinesp. 120
HorizontalAlignp. 122
ShowHeader and ShowFooterp. 122
ToolTipp. 122
Customizing Individual Stylesp. 124
GridView and DetailsView Stylesp. 124
Empty Tablesp. 126
DetailsView-Specific Stylesp. 128
Column Styles and Field Stylesp. 129
Using Cascading Style Sheetsp. 131
Precedence of Stylesp. 135
Themes and Skinsp. 138
Using Auto Format in Visual Studiop. 140
Common Mistakesp. 140
Summaryp. 141
Exercisesp. 142
Chapter 7 Paging and Sorting Datap. 143
Sortingp. 144
Requirements to Enable Sortingp. 145
Sort Expressionsp. 147
Pagingp. 151
Enabling Pagingp. 152
Customizing Paging and the Pagerp. 153
Paging Theory and Alternativesp. 158
Relationship of Sorting, Paging, and Selectingp. 158
Common Mistakesp. 159
Summaryp. 160
Exercisesp. 160
Chapter 8 Displaying Data in Listsp. 161
Introductionp. 162
Transition from GridView to Other Formatsp. 162
Types of List Controlsp. 163
Concepts Common to List Controlsp. 163
Text versus Value in List Itemsp. 164
Data-Binding List Controlsp. 165
DataTextField and DataValueFieldp. 165
DropDownList Controlp. 169
Handling Selection in a Listp. 169
SelectedIndex and SelectedValuep. 169
Automatic Postbackp. 171
Common Mistakesp. 173
Summaryp. 174
Chapter 9 Filtering and Master-Child Datap. 175
Filtering GridView Records Using a QueryStringp. 177
Filtering GridView Records Using a TextBoxp. 179
Using the SQL LIKE Operatorp. 181
The Theory of Selection and ControlParametersp. 182
Filtering GridView Records Using a List Controlp. 184
Master Control by DropDownList with Hard-Coded Itemsp. 184
Master Control by List Boxes with Data-Bound Itemsp. 185
Master Control by List Boxes with a Default Setting That Initially Hides the GridViewp. 187
Displaying Details Using a GridView and DetailsView on the Same Pagep. 191
Displaying Details Using a GridView and DetailsView on Different Pagesp. 195
Cascading DropDownListsp. 200
Common Mistakesp. 201
Summaryp. 201
Exercisesp. 202
Chapter 10 Displaying Data in Templated Controlsp. 205
Using Templated Controlsp. 209
Data Binding in Templatesp. 209
Content Suitable for Addition to a Templatep. 210
GridView and DetailsView Template Fieldsp. 211
DataList Controlp. 214
Repeater Controlp. 219
DetailsView Controlp. 220
Navigation in Templated Controlsp. 220
FormView Controlp. 221
Comparing and Selecting the Templated Controlsp. 223
Common Mistakesp. 225
Summaryp. 226
Exercisesp. 227
Chapter 11 Updating and Deleting Datap. 229
Overview of Modifyingp. 230
Command Fieldsp. 231
Simple Updatep. 233
DataKeyNames and Updatesp. 236
Update in a DetailsViewp. 238
Parameters Collectionsp. 239
Handling NULLs in Updatesp. 240
Delete to Remove Entire Recordsp. 242
Common Mistakesp. 244
Summaryp. 245
Exercisesp. 245
Chapter 12 Inserting New Recordsp. 247
Support for Insertp. 248
What Happens under the Hood?p. 248
Setup for Insertp. 249
Insertion Modep. 249
Action Performed by ASP.NET 2.0 on Insertp. 249
Database Considerations When Insertingp. 249
Basic Insert Using DetailsViewp. 250
Enabling Insert in a Data Source Controlp. 252
DetailsView INSERT Starting from GridViewp. 254
GridView and DetailsView for Insert on Same Pagep. 254
GridView on One Page with DetailsView on a Second Pagep. 254
Insert Using Template Fieldsp. 255
Using the Bind Syntax in InsertltemTemplatep. 256
Data Entry with RadioButtonLists and DropDownListsp. 257
Data Entry with Check Boxesp. 260
Inserting with FormViewp. 261
Common Mistakesp. 265
Summaryp. 265
Chapter 13 Business Objects as a Source of Datap. 267
Introductionp. 267
Layers of an N-Tier Applicationp. 268
Presentation Layerp. 268
Business Logic Layerp. 268
Data Access Layerp. 268
Advantages of N-Tier Architecturesp. 269
Building a Data Access Logic Layer Using VS DataSetsp. 269
Creating a Data Access Logic Layer Using the VS DataSet Designerp. 269
Data-Binding to a DataSetp. 272
Implementing Master Details Capabilityp. 273
Implementing and Data-Binding to Custom Objectsp. 277
Implementing Sorting in a Custom Objectp. 284
Common Mistakesp. 288
Summaryp. 288
Chapter 14 XML and Other Hierarchical Datap. 289
What Is Hierarchical Data?p. 290
Types of Hierarchical Data?p. 290
ASP.NET 2.0 Hierarchical Data Controlsp. 290
XmIDataSource Controlp. 291
TreeView Control to Display Hierarchical Datap. 291
Display XML Datap. 294
XPath with XmIDataSourcep. 294
Formatting the TreeViewp. 297
XSL Transformation with XMLp. 300
Handling Events in a TreeView Controlp. 303
Hierarchical Data with Controls Other Than TreeViewp. 305
XML and GridViewp. 306
Use XML Source with DataListp. 308
Use XPath to Display Data in a DataList Controlp. 310
XML and DataList with Nestingp. 312
Common Mistakes with XmIDataSource Controlsp. 315
Summaryp. 315
Chapter 15 Caching Datap. 317
Caching and Its Benefitsp. 317
When to Use Cachingp. 318
Understanding Statep. 319
Understanding State Stalenessp. 319
Caching Options in ASP.NET 2.0p. 319
Displaying Data in ASP.NETp. 320
Time-Based Cachingp. 323
Caching with Parametersp. 325
Implementing Filtering Capabilityp. 327
SQL Cache Invalidationp. 330
Caching Partial Pagesp. 334
Common Mistakesp. 337
Summaryp. 337
Chapter 16 Handling Events for Data Controlsp. 339
Execution Control When an Event Is Triggeredp. 340
Types of Eventsp. 340
General Techniques for Writing Event Handlersp. 341
Transfer of Values When an Event Is Triggeredp. 344
Object Senderp. 345
EventArgsp. 345
Location of Event Handlersp. 346
Command and Custom Button Eventsp. 350
Using Events Raised by Command Buttons (Command Fields)p. 351
Using Events Raised by Buttons with Custom Behaviorp. 351
List Selection and Page Eventsp. 353
Data Control Binding Eventsp. 356
General Error Eventsp. 358
Common Mistakesp. 361
Summaryp. 362
Exercisesp. 362
Appendix A A Short and Practical Introduction to SQL Statementsp. 363
Appendix B Exercise Answersp. 375
Indexp. 391