search for books and compare prices
Tables of Contents for Beginning C# Databases
Chapter/Section Title
Page #
Page Count
Introduction
1
1
Who Is This Book For?
2
1
What Does This Book Cover?
2
1
What Do I Need to Use This Book?
3
1
Conventions
3
1
Customer Support
4
5
How to Download the Sample Code for the Book
4
1
Errata
5
1
E-mail Support
5
1
p2p.wrox.com
6
1
Why This System Offers the Best Support
6
3
Installing MSDE
9
16
Installing MSDE with the .NET Framework
10
2
Installing the .NET Framework
10
2
Installing MSDE and the Sample Databases
12
1
Installing MSDE with Visual Studio.NET
12
1
Connecting to MSDE using MS Access
13
3
Authentication Types
15
1
Windows Authentication
15
1
SQL Server Authentication
16
1
Mixed Mode
16
1
Exploring the Database
16
3
Tables, Columns, Rows, and Relationships
17
2
Connecting using the Server Explorer
19
4
The limitations of Visual C# Standard Edition
22
1
Summary
23
2
A Simple Data-Driven Application
25
18
Creating the Application
25
3
Establishing Contact with the Database
28
3
Data Binding
31
8
Editing Data
39
2
Summary
41
1
Exercises
41
2
Introducing SQL
43
24
What is SQL?
43
1
Using SQL
44
5
Running SQL Statements from Visual Studio .NET
45
2
Running SQL from the Command Line
47
2
The Custom Query Tool
49
1
Reading Data
49
8
The Select Statement
49
3
The Where Clause
52
3
Sorting the Data
55
2
Inserting Data
57
2
Insert Into Statement
57
2
Updating Data
59
1
The Update Statement
59
1
Deleting Data
60
2
SQL Data Types
62
1
Numeric Data Types
62
1
String Data Types
63
1
Date and Time Data Types
63
1
Binary Data Types
63
1
Restoring the Northwind Database
64
1
Summary
65
1
Exercises
65
2
What's ADO.NET?
67
26
Why ADO.NET?
67
3
Moving on from ADO
67
1
From ADO to ADO.NET
68
1
ADO.NET and the .NET Framework
69
1
Architecture of ADO.NET
70
16
.NET Data Providers
72
2
SQL Server .NET Data Provider
74
5
OLEDB .NET Data Provider
79
3
ODBC .NET Data Provider
82
4
Components of .NET Data Providers
86
3
The Connection Object
86
1
The Command Object
87
1
The DataReader Object
87
1
The DataAdapter Object
87
1
The DataSet
88
1
Summary
89
1
Exercises
90
3
Connecting to the Database
93
32
Connection Objects in .NET Data Providers
93
1
Connecting to MSDE with SqlConnection
94
10
Debugging Connections to SQL Server
99
2
Connecting to a SQL Server on Another Server Machine
101
1
Security and Passwords in SqlConnection
101
1
How to Use SQL Server Security
102
1
Connection String Clauses in SqlConnection
102
2
Connection Pooling
104
1
Improving Your Use of Connection Objects
104
7
Using the Connection String in the Connection Object Constructor
104
1
Use finally for Closing Connections
104
3
Displaying Connection Information
107
4
Connecting to Microsoft Access with OleDbConnection
111
3
Connecting to Oracle with OleDbConnection
114
1
Connecting to MySQL with OdbcConnection
115
3
Connecting to Oracle with OracleConnectlon
118
3
Summary
121
1
Exercises
122
3
Getting the Data
125
32
Creating a Command Object
126
4
Associating a Command with a Connection
128
1
Assign a Command Text to a Command Object
129
1
Executing Commands
130
3
Executing Commands with Multiple Results
133
2
Executing Non-Query Commands
135
8
Creating Tables
139
2
Creating Databases
141
2
Command Parameters
143
5
Using Command Objects in Other .NET Data Providers
148
6
Summary
154
1
Exercises
154
3
Using the DataReader
157
26
Getting to Know ADO.NET Data Readers
157
1
Under the Hood of the DataReader
158
14
Using Ordinal Indexers
162
3
Using Column-Name Indexers
165
1
Using Typed Accessor Methods
166
6
Learning More about the Data
172
3
Getting Schema Information for a DataReader
175
4
Using Multiple Resultsets in a DataReader
179
1
Summary
180
1
Exercises
181
2
The DataSet and DataAdaoter
183
28
The Object Model
184
3
DataSets versus Data Readers
184
1
A Brief Introduction to DataSets
184
2
Getting Acquainted with the DataAdapter
186
1
Creating a DataAdapter
186
1
DataTables, DataColumns, and DataRows
187
1
Working with DataSets and DataAdapters
187
17
Populating a DataSet
188
3
Filtering and Sorting in the DataSet
191
4
Using DataViews
195
2
Modifying Data in the DataSet
197
3
Persisting changes to the data store
200
1
UpdateCommand
200
1
InsertCommand
201
1
DeleteCommand
201
1
Using the CommandBuilder
202
1
Managing Conflicts
203
1
DataSets and XML
204
2
Typed and Untyped DataSets
206
1
Summary
207
1
Exercises
208
3
Data and Windows Applications
211
26
What is Data Binding?
212
10
Simple Data Binding
212
2
Complex Data Binding
214
3
Data Binding - Behind the scenes
217
1
Synchronizing Controls with the Data Source
218
4
Types of data sources
222
6
Binding to Arrays
222
1
Binding to DataTables
223
3
Binding to DataSets
226
1
Binding to DataViews
227
1
The DataGrid
228
3
Updating the Data Source Using a DataGrid
231
3
Summary
234
1
Exercises
235
2
ASP.INET
237
38
The Basics
237
15
Web Forms
238
6
Viewing the code Behind
244
2
Binding Data to a DataGrid
246
1
Paging in a DataGrid
247
3
Combining the DataGrid and DataSet
250
2
The ASP.NET Page Lifecycle
252
10
Building for Scalability
253
2
Selecting a Row
255
5
Using Bound Columns
260
2
Editing a DataGrid
262
10
Template Columns
266
2
Deleting Rows
268
2
Sorting a DataGrid
270
2
Summary
272
1
Exercises
272
3
Validating Web-Based User Input
275
26
Web Validation
279
1
Client-Side Validation
279
1
Disabling Client-Side Validation
279
1
Server-Side Validation
279
1
Validation in the Page Life Cycle
280
1
ASP.NET Validation Controls
280
16
The RangeValidator Control
281
4
The CompareValidator Control
285
1
The RegularExpressionValidator Control
286
2
The CustomValidator Control
288
3
ValidationSummary Control
291
4
Using In-Line and Summary Errors
295
1
Programmatic Validation
296
1
Summary
297
1
Exercises
298
3
Tables and Relationships
301
28
Tables
301
6
Creating a Table
302
3
Adding Rows to a Table
305
1
Dropping a Table
306
1
Table Relationships
307
9
Keys and Constraints
307
1
Primary Keys
308
1
Foreign Keys
308
1
Types of Relationships
309
2
Referential Integrity
311
1
Database Diagrams
312
3
Constraints
315
1
Normalization
315
1
Working with Table in C#
316
10
Summary
326
1
Exercises
327
2
SQL Queries
329
26
Northwind Query Application, Part II
330
5
SQL Commands
335
17
Distinct
335
1
Subqueries
336
1
In
336
3
Group By
339
1
Aggregates
340
2
Date Functions
342
1
CASE Statement
343
2
Joins
345
1
Inner Join
346
2
Outer Join
348
1
Full Join
348
2
Cross Join
350
1
Like
350
2
Summary
352
1
Exercises
353
2
Views and Stored Procedures
355
36
Views
355
11
Creating a View using C#
360
6
Stored Procedures
366
23
Working With Stored Procedures in C#
376
13
Summary
389
1
Exercises
389
2
Indexes and Constraints
391
30
Indexes
391
15
Taking Advantage of Indexes
395
1
Searching For Records
395
1
Sorting Records
396
1
Grouping Records
396
1
Maintaining a Unique Column
396
1
Index Drawbacks
397
1
Indexes and Disk Space
397
1
Indexes and Data Modification
398
1
Clustered Indexes
398
2
Composite Indexes
400
1
Covering Queries with an Index
400
1
Matching Index Search Criteria
401
2
Additional Index Guidelines
403
1
Keep Index Keys Short
403
1
Distinct Index Keys
404
1
Maintaining Indexes
404
1
View Existing Indexes
404
1
Rename an Index
405
1
Delete an Index
405
1
Constraints
406
11
Data Integrity
406
1
Unique Constraints
407
2
Check Constraints
409
2
Check Constraint Samples
411
1
Check Constraints and Existing Values
411
1
Check Constraints and NULL Values
412
1
Restrictions On Check Constraints
412
1
NULL Constraints
413
1
Default Constraints
414
1
Maintaining Constraints
415
1
Dropping Constraints
415
1
Disabling Constraints
415
2
Summary
417
1
Exercises
418
3
Authentication and Authorization
421
26
The AdminHelp Utility
422
1
Introduction to Database Security
422
1
Authentication
423
2
Windows Authentication Mode
424
1
Mixed Mode Authentication
425
1
Managing Users
425
10
Database Logins
425
2
Adding and Removing Login Entries
427
1
SQL Server Logins
427
1
Special Users
428
1
User Accounts
429
1
Adding a User Account
429
1
Viewing User Accounts
430
1
Removing a User Account
431
1
Managing Roles
431
1
Fixed Server Roles
432
1
Fixed Database Roles
433
1
Creating Roles
434
1
Applying Permissions
435
8
Revoke a Permission
436
1
Grant A Permission
436
1
Deny a Permission
436
1
Resolving Permission Conflicts
437
1
Object Permissions
438
1
Statement Permissions
439
1
Viewing Permissions
440
3
Implementing Security
443
1
Summary
444
1
Exercises
445
2
XML and ADO.NET
447
20
The Pros and Cons of XML
447
2
The Structure of an XML Document
449
3
Schemas
452
4
Valid XML
455
1
ADO.NET and XML
456
4
Application Configuration Using XML
460
4
Where To Go From Here
464
1
Summary
465
1
Exercises
465
2
Handling ADO.NET and Database Exceptions
467
26
General Exception Handling in C#
468
3
The Generic Exception Class
469
2
The throw Statement
471
1
ADO.NET Exceptions and Database Exceptions
471
1
Exception Classes
472
1
ADO.NET Exceptions
473
8
Database Exceptions
481
9
Summary
490
1
Exercises
491
2
Transactions
493
30
When to Use/ When Not To Use Transactions
494
1
ACID Properties
495
1
Transaction Statements
496
22
Working with SQL Transactions
496
13
Nested Transactions
509
1
ADO.NET Transactions
510
1
The SqlTransaction class
511
1
ADO.NET Transaction Code Guidelines
511
7
What Next?
518
1
Summary
519
1
Exercises
520
3
ADO.NET Events
523
24
Events and Delegates
523
2
Adding and Removing Event Handlers
525
1
ADO.NET Events
525
18
Connection Object Events
526
1
The StateChange Event
526
5
The InfoMessage event
531
4
Row Update Events
535
6
Working With Multiple Handlers
541
2
Summary
543
1
Exercises
544
3
Irregular Data
547
46
SQL Server Data Types for Irregular Data
548
1
Advantages/Disadvantages of Irregular Data Types
548
1
Storing Images in a Database
549
16
Displaying Images With Headers
561
4
Extracting Binary Data to Files
565
7
Working with Large Text Files
572
9
Retrieving Data from Large Text Columns
578
3
Irregular Data In Other ADO.NET Data Providers
581
8
Irregular Data Type Enumeration Differences Between Providers
583
4
Irregular Data in the ODBC.NET Data Provider
587
2
Summary
589
1
Exercises
590
3
Appendix A: The Custom Query Tool Application
593
12
Appendix B: XML Primer
605
14
XML
605
14
XML Documents
605
1
XML Elements
605
1
Attributes
606
1
The XML Declaration
607
1
Structure of an XML Document
608
1
XML Namespaces
608
1
Well-formed and Valid XML
609
1
Validating XML Documents
610
1
Schemas
610
9
Index
619