Database Programming with C#

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

The book is useless, and I am a teacher, so I know what I am talking about. No wonder I was able to get a used copy for that cheap. Every body who buy it is trying to get rid of it. I looked through it once and never took it up again. This cannot help anybody. It like reading something in a newspaper. No way to apply it.

Author(s): Carsten Thomsen
Edition: 1st
Publisher: Apress
Year: 2002

Language: English
Pages: 521

Table of Contents......Page 3
Database Programming with C#......Page 13
Technology Requirements......Page 16
Feedback......Page 17
Reviewing Programming Concepts......Page 18
A Quick Look at Components of the .NET Framework......Page 19
Assemblies and Namespaces......Page 22
Getting Cozy with the VS .NET Integrated Development Environment......Page 25
Two Interface Modes......Page 26
Command Window......Page 27
Built-in Object Browser......Page 28
Integrated Help System......Page 29
Macros......Page 30
Text Editors......Page 31
Server Explorer......Page 32
Toolbox......Page 33
Summary......Page 34
Why Use a Database?......Page 35
Hierarchical Databases......Page 36
What C# Programmers Need to Know About Relational Databases......Page 37
UserMan Database Schema......Page 48
Summary......Page 49
Overview......Page 50
Data Providers and Drivers......Page 52
.NET Data Providers......Page 54
The Connection Class......Page 55
ConnectionString Property......Page 56
Connection Class Properties......Page 65
Connection Class Methods......Page 67
Connection Class Events......Page 70
Opening a Connection......Page 71
Comparing Two Connection Objects......Page 72
Manipulating the Connection State......Page 73
Pooling Connections......Page 75
Handling Provider, Driver, and Data Source Messages......Page 79
Transactions......Page 80
Handling Connection Class Exceptions......Page 88
Using Command Objects......Page 97
OleDbCommand, OdbcCommand, and SqlCommand......Page 98
Command Class Properties......Page 101
Command Class Methods......Page 107
Executing a Command......Page 108
Handling Command Class Exceptions......Page 110
Using the DataReader Class......Page 112
Declaring and Instantiating a DataReader Object......Page 113
Closing a DataReader......Page 114
Handling Multiple Results......Page 115
DataReader Methods......Page 116
XmlReader......Page 122
XmlReader Properties......Page 123
XmlReader Methods......Page 124
Declaring and Instantiating an XmlReader Object......Page 127
Handling XmlReader Exceptions......Page 128
The DataAdapter Explained......Page 129
DataAdapter Properties......Page 130
DataAdapter Events......Page 131
Instantiating a DataAdapter......Page 132
Setting the Command Properties......Page 134
Handling Fill Operation Errors......Page 138
Handling Row Updates......Page 139
When to Use the CommandBuilder Class......Page 141
Preparing the DataAdapter......Page 142
Summary......Page 143
Using the DataSet Class......Page 145
Recordset vs. DataSet......Page 146
DataSet Properties......Page 147
DataSet Methods......Page 150
DataSet Events......Page 152
Instantiating a DataSet......Page 153
Populating Your DataSet Using the DataAdapter......Page 154
Updating Your Data Source Using the DataAdapter......Page 156
Merging Data in a DataSet with Other Data......Page 158
Detecting and Handling Changes to Data in a DataSet......Page 160
Accepting or Rejecting Changes to Data in a DataSet......Page 162
DataTable Properties......Page 164
DataTable Methods......Page 166
DataTable Events......Page 168
Building Your Own DataTable......Page 169
Copying a DataTable......Page 171
Searching a DataTable and Retrieving a Filtered Data View......Page 172
Copying Rows in a DataTable......Page 173
Handling Column Changes......Page 175
Handling Row Changes......Page 176
Handling Row Deletions......Page 178
DataView Properties......Page 179
DataView Methods......Page 180
DataView Events......Page 181
Searching a DataView......Page 182
Sorting a DataView......Page 183
Using the DataRow Class......Page 184
Declaring and Instantiating a DataRow......Page 186
Using the DataColumn Class......Page 187
Declaring and Instantiating a DataColumn......Page 188
Using the DataRelation Class......Page 189
Declaring and Instantiating a DataRelation......Page 190
Looking at Cursors......Page 195
Cursor Types......Page 196
Pessimistic Locking......Page 198
Optimistic Locking......Page 200
Using "Classic" ADO and COM Interop......Page 206
Summary......Page 207
Handling Data Connections......Page 209
Handling Servers......Page 212
Looking at Database Projects......Page 218
Deleting a Database Project Folder......Page 220
Adding Database Objects to a Database Project......Page 221
Designing Databases with the Database Designer......Page 224
Creating a Database Diagram......Page 225
Adding Columns......Page 230
Adding Indexes and Keys......Page 231
Adding Constraints......Page 232
Designing Queries with the Query Designer......Page 234
Taking a Closer Look at the Query Designer Panes......Page 235
Verifying the SQL Syntax......Page 239
Examining the Various Query Types......Page 240
Script Editing Using the SQL Editor......Page 242
Using the Query Editor to Produce SQL Statements......Page 243
Running SQL Scripts......Page 244
Using the DataSet Designer to Create a Typed Data Set......Page 245
Summary......Page 247
Overview......Page 248
Using Two or More Exception Handlers in One Procedure......Page 249
Examining the Exception Class......Page 250
Handling Exceptions in the Exception Handler......Page 251
Filtering Exceptions......Page 255
Creating Your Own Exception......Page 256
Handling Data-Related Exceptions......Page 257
CLR Handling of Exceptions......Page 258
Enabling Debugging......Page 259
Disabling Debugging......Page 260
Using Debug Assertions......Page 261
Using Debug Error Messages......Page 262
Summary......Page 263
Optimization Issues......Page 264
Troubleshooting Performance Degradation......Page 266
Using Stored Procedures......Page 267
Why Use a Stored Procedure?......Page 268
Creating and Running a Stored Procedure......Page 269
Retrieving a Value Specified with RETURN......Page 278
Running Oracle Stored Procedures......Page 279
Why Use a View?......Page 284
Creating a View......Page 285
Using a View from Code......Page 286
Why Use a Trigger?......Page 289
Creating a Trigger......Page 290
Summary......Page 293
Looking at LDAP......Page 295
Examining the System.DirectoryServices Namespace......Page 296
Studying the DirectoryEntry Class......Page 297
Searching for an Object in Active Directory......Page 301
Manipulating Object Property Values......Page 305
Accessing Active Directory Using the OLE DB .NET Data Provider......Page 308
Specifying What Information to Retrieve from Active Directory......Page 309
Retrieving the SID for a User......Page 310
Accessing Microsoft Exchange Server......Page 311
Using the Microsoft OLE DB Exchange Server Provider......Page 312
Using the Microsoft OLE DB Provider for Internet Publishing......Page 313
Accessing Exchange Server As a Linked Server from SQL Server......Page 315
Summary......Page 319
Connectionless Programming......Page 320
When to Use a Message Queue......Page 321
Creating the Queue Programmatically......Page 323
Displaying or Changing the Properties of Your Message Queue......Page 325
Binding to an Existing Message Queue......Page 327
Sending a Message......Page 328
Retrieving a Message......Page 329
Peeking at Messages......Page 332
Picking Specific Messages from a Queue......Page 333
Retrieving All Messages in a Queue......Page 334
Sending and Retrieving Messages Asynchronously......Page 335
Clearing Messages from the Queue......Page 336
Prioritizing Messages......Page 338
Locating a Message Queue......Page 339
Removing a Message Queue......Page 341
External Transactions......Page 342
Starting a Transaction......Page 343
Using the MessageQueueTransaction Class......Page 344
Looking at System-Generated Queues......Page 346
Using Journal Storage......Page 347
Using Authentication......Page 350
Using Encryption......Page 353
Using Access Control......Page 356
Summary......Page 359
Looking at Object Oriented Programming......Page 360
Inheritance......Page 361
Encapsulation......Page 363
C# Keywords Related to OOP......Page 364
Creating the CUser Class......Page 366
Summary......Page 374
Data-Bound Controls vs. Manual Data Hooking......Page 375
Using Data-Bound Controls with Windows Forms......Page 376
Using Data-Bound Controls with Web Forms......Page 387
Summary......Page 398
Database Objects......Page 399
Active Directory Object......Page 409
Creating a Windows Client......Page 411
Database Suggestions......Page 412
General Suggestions......Page 413
Summary......Page 414
Overview......Page 415
Installing SQLXML 2.0......Page 418
Configuring the ISAPI Extension......Page 419
Restarting the Virtual Directory Application......Page 424
Inspecting the SQLXML 2.0 Managed Classes......Page 432
Summary......Page 450
Symbols and Numbers......Page 451
Index......Page 479
Appendix A: Using XML with SQL Server 2000......Page 507