did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780321243621

Hitchhiker's Guide to Visual Studio and SQL Server Best Practice Architectures and Examples

by ;
  • ISBN13:

    9780321243621

  • ISBN10:

    0321243625

  • Edition: 7th
  • Format: Paperback
  • Copyright: 2006-11-02
  • Publisher: Addison-Wesley Professional

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

List Price: $64.99 Save up to $16.25
  • Buy Used
    $48.74
    Add to Cart Free Shipping Icon Free Shipping

    USUALLY SHIPS IN 2-4 BUSINESS DAYS

Supplemental Materials

What is included with this book?

Summary

Since 1994 when he wrote his first "Hitchhikerrs"s Guide", William Vaughn has been providing developers all over the world the intimate details of how SQL Server can be accessed and managed from RAD languages like Visual Basic and Visual Basic .NET. With the 7th Edition, Bill has completely rewritten this encyclopedic work from cover to covergiving readers his insightful views on how applications should be built to maximize both developer and code performance. Visual Studio and the languages it hosts have never been as sophisticated as they are todaythe same can be said for SQL Server. This makes it even more important for developers to understand how to best leverage their features without being held back by their complexity. Thatrs"s what this book is all aboutmaking it easier for developers regardless of their know-how. The 7th edition is unique in that itrs"s designed to provide not only up-to-date tutorials on the latest development tools provided by Visual Studio and SQL Server, but also a solid platform of architectural advice and rich examples for developers trying to choose between the myriad of platform options. Beginners and experts alike will find comprehensive step-by-step instructions that can make the readerrs"s introduction to the latest versions of Visual Studio and SQL Server far easier. Key topic coverage includes: bull; Data access architectures and how to choose the best strategy for Windows Forms, ASP.NET, XML Web Services, and SQL Server CLR executables. Where do these make sense and how much will they cost to build and maintain? bull; SQL Server and relational database fundamentals and inner-machinery. How does SQL Server work and why is it important that developers know? bull; Making the development experience more productive through judicious use of the Visual Studio toolset, and how to know when the wizards can help. bull; Using the latest ADO.NET data provider efficiently and safely. bull; How to protect the security of your databaseand your jobby avoiding common mistakes. bull; How to build secure, efficient, scalable applications in less time with fewer resourceshow to create faster code faster. bull; How to leverage the potential of SQL Server CLR executables and knowing when these features make sense. bull; How to work with your DBA to maintain database integrity and security. bull; Working with the new Visual Studio report controls to expose your organizationrs"s data safely and easily with or without leveraging existing SQL Server Reporting Services technology. William R. Vaughnis the President of Beta V Corporation and a Microsoft MVP. In 2000 he retired from Microsoft after 14 years to focus on mentoring, speaking, and writing. His specialty is data access application design especially when connecting to SQL Serverover the years hers"s written 12 books on the subject. Hers"s a popular speaker at technical conferences all over the world where his wit and no-holds-barred technical insights win him rave reviews. William is also a member of the prestigious INETA Speakerrs"s Bureau. His works include articles for SQL Server Magazine and a bi-weekly editorial for Processor Magazine as well as books published by Microsoft Press and Apress.

William R. Vaughn is the President of Beta V Corporation and a Microsoft MVP

Table of Contents

Forewordp. xxi
Acknowledgmentsp. xxiii
About the Authorsp. xxv
Introductionp. 1
Exploring Application Architecturesp. 9
Introductionp. 9
Choosing the "Right" Architecturep. 10
Understanding Your Toolsetp. 12
A Brief History of ADO and ADO.NETp. 13
Jet and ODBC Are Bornp. 13
Data Access Objects (DAO) Is Bornp. 15
OLE DB Is Spawnedp. 16
AD0.NET Is Createdp. 17
Recognizing Application Design Constraintsp. 19
What Makes "Good," "Better," and "Best" Designs?p. 20
Designing Before Implementingp. 23
Choosing the Right Data Access Interfacep. 25
Choosing the Right Data Access Providerp. 26
What About SQL Server Everywhere Edition?p. 27
Using the SQL Server Native Clientp. 35
Choosing the Right Database Management Systemp. 35
What Does SQL Server Cost?p. 35
What About SQL Server Security?p. 36
What About Performance?p. 38
What About Multi-User Issues?p. 48
What About Scalability?p. 50
What Are the Limits?p. 51
What Can Get in the Way on the Client?p. 53
What Can Get in the Way on the Server?p. 54
What About Maintenance and Administration?p. 55
Managing Maintenance Tasksp. 56
The Importance of Restoring Datap. 56
Managing Resourcesp. 62
Understanding Basic Data Access Architecturesp. 63
Multi-Tiered Designsp. 64
Building Stand-Alone Applicationsp. 67
ASP Browser-Based Architecturesp. 84
XML Web Service Architecturesp. 85
Summaryp. 86
How Does SQL Server Work?p. 87
Introductionp. 87
Servers and Versionsp. 88
SQL Server Side-By-Sidep. 90
Introducing...SQL Server Express Editionp. 92
What About the Workgroup Edition?p. 102
Installing SQL Serverp. 103
Running SQL Server Servicesp. 111
Inspecting SQL Server Servicesp. 111
Starting a SQL Server Servicep. 113
Touring the SQL Server System Databasesp. 115
SQL Server Instancesp. 115
Multiple Instances or Multiple Databases?p. 116
User and System Databasesp. 117
Creating a User Databasep. 119
Managing User Databasesp. 120
Understanding the SQL Server Security Systemp. 120
Addressing Objects in SQL Server 2005p. 121
How SQL Server 2005 Addresses the Ownership Chain Issuep. 126
Understanding Logins, Usernames, and Schemasp. 127
Creating Security Personasp. 134
Managing SQL Server Connectionsp. 135
Understanding the Data Access Interface Rolep. 136
Understanding the Protocolsp. 136
Opening a Connectionp. 137
Debugging a Connectionp. 141
Choosing a Connection Strategyp. 145
Using the SQL Query Toolsp. 147
Creating a New Queryp. 148
Creating Select Queriesp. 150
Using Aliases for Table and Column Namesp. 153
Walking Through the Select Operationp. 154
Understanding the Where Clausep. 155
Using Parameters to Pass Literal Valuesp. 156
Limiting the Number of Rows Returnedp. 157
Using the Where Clause to Perform Joinsp. 158
Dealing with Special-Case Query Problemsp. 164
Creating and Querying Viewsp. 178
T-SQL Viewsp. 179
Database Snapshotsp. 182
Implementing Business Rulesp. 182
Implementing Business Rules with Extended Propertiesp. 184
Implementing Business Rules with T-SQL Rules, Constraints, and Defaultsp. 190
User-Defined (Aliased) Typesp. 193
Implementing Constraintsp. 194
Managing Databases and Queries with Batches and Scriptsp. 197
Scripts Versus Batchesp. 198
The Query Optimizer and the Query Planp. 199
Viewing and Tuning the Query Planp. 200
Examining Client Statistics and Alternate Plansp. 201
Executing the Query Planp. 206
Understanding the Buffer Cachep. 207
Managing Cached Query Plansp. 207
Executing Action Commandsp. 210
Inserting New Rowsp. 211
Updating Rowsp. 219
Introducing Stored Proceduresp. 231
Introducing Triggersp. 233
Creating a DML Triggerp. 234
Creating a DDL Triggerp. 235
Using Transactions to Protect Data Integrityp. 235
Administrative Functionsp. 237
Attaching a .MDF Database Filep. 237
Setting the Auto Close Optionp. 239
Importing and Exporting Datap. 240
Backing Up SQL Server Databasesp. 240
Working with the Transaction Logp. 242
Summaryp. 243
Relational Databases 101p. 245
Introductionp. 245
Getting Started with Solid Database Designp. 246
Understanding Relational Database Normalizationp. 248
Creating Tables, Rows, and Columnsp. 251
How SQL Server Stores Relational Databasesp. 252
Choosing the Right Data Typep. 265
Summaryp. 272
Getting Started with Visual Studiop. 273
Introductionp. 273
How I Got Herep. 274
Installing the "Right" Version of Visual Studiop. 275
Dealing with CTP or Beta Shardsp. 276
Walking Through a Typical Installationp. 276
Installing the MSDN Documentationp. 281
Launching Visual Studiop. 282
Installing the Visual Studio 2005 Image Libraryp. 283
Customizing Visual Studio 2005p. 284
Saving and Loading Custom Configurationsp. 287
Creating Custom Project Templatesp. 289
Configuring Online or Local Helpp. 296
Configuring Server (or Database) Explorersp. 297
Creating a New Database with the Server Explorerp. 298
Creating a New Database in Codep. 300
Creating and Managing Database Connectionsp. 301
Managing Database Objects with the Server Explorerp. 309
Changing Existing Objectsp. 321
Managing Queries with the Query Designerp. 323
Getting Familiar with the Query Designerp. 324
The Query Designer Panesp. 324
What's a "Derived" Table?p. 327
Changing the Query Typep. 328
The Query Designer-a Recapp. 337
Using the Server Explorer to View Synonymsp. 338
Using the Server Explorer to Manage Typesp. 340
Using the Server Explorer to Manage Assembliesp. 343
Using the Server Explorer to Manage Serversp. 343
Summaryp. 347
Managing Executables with the Server Explorerp. 349
Introductionp. 349
Creating and Editing Stored Proceduresp. 350
Comparing SQL Server 2005 and Visual Studio 2005p. 351
Enter the SQL Server Management Studio Expressp. 352
Creating New Stored Proceduresp. 352
Creating and Editing Complex Stored Proceduresp. 359
Executing T-SQL with Run Selectionp. 363
Debugging Stored Proceduresp. 364
T-SQL Debugging Against a Local Instancep. 365
Debugging with Breakpoints Within Stored Proceduresp. 367
Debugging Stored Procedures on Remote Instancesp. 371
Debugging Stored Procedures from Codep. 375
Using the Server Explorer to Manage Functionsp. 377
Creating T-SQL Functions with the Server Explorerp. 380
Summaryp. 389
Building Data Sources, DataSets, and TableAdaptersp. 391
Why Create YADAI?p. 392
Is Strongly Typed Data Important?p. 394
What Is a Data Source?p. 396
What Is a TableAdapter?p. 400
What's Missing in the TableAdapter?p. 402
Creating Database-Based Data Sourcesp. 403
Building a Single-Table TableAdapterp. 404
Configuring a TableAdapterp. 412
Adding Parameters to a Queryp. 422
Choosing Query Methods to Generatep. 425
Binding to the TableAdapter Using Drag and Dropp. 429
Customizing the Generated UIp. 432
Using SmartTags to Manage Bound Controlsp. 434
Binding to "Details"p. 435
Binding to Custom Controlsp. 436
Using a TableAdapter Directly-Without Drag-and-Drop?p. 436
Managing DataTable Classes in the Data Source Designerp. 438
The Generated Form Codep. 440
Moving Data Sources Between Applicationsp. 441
Creating Web Service Data Sourcesp. 442
What Is a Web Service?p. 443
Constructing a Sample Web Servicep. 444
Consuming and Testing Web Servicesp. 454
Exposing the Web Service Data Source in the UIp. 457
Summaryp. 459
Managing Data Tools and Data Bindingp. 461
Introductionp. 461
Touring the Visual Studio Toolboxp. 463
Exposing Deprecated Data Access Controlsp. 464
Finding the Right Controlp. 465
Understanding the Tool Trayp. 466
Using the DataSet Toolbox Elementp. 467
Introduction to Data Bindingp. 468
Complex Versus Simple Bindingp. 470
Using the BindingSource Classp. 476
Using the EndEdit and CancelEdit Methodsp. 485
Data Binding Using the BindingSource Classp. 488
Using the BindingNavigator Controlp. 489
Using the DataGridView Controlp. 492
Using the ProgressBar Controlp. 494
Summaryp. 495
Getting Started with ADO.NETp. 497
Introductionp. 497
Approaching Data Access Challengesp. 498
ADO.NET from 50,000 Feetp. 500
Working with Data Sourcesp. 501
Using the Visual Studio Object Browser to Explore ADO.NETp. 502
Exploring ADO.NET with a Class Diagramp. 504
Deciphering the Namespacesp. 508
Getting a Handle on the Class Namesp. 508
Using Shorthand to Address Classesp. 509
Instantiating ADO.NET Objectsp. 510
Understanding Code Scopep. 510
Understanding Object Instantiationp. 512
The Using Block in Visual Basic.NETp. 514
Exploring the System.Data.SqlClient Namespacep. 515
Choosing the Right Provider-When it's Not SQL Serverp. 516
Exploring the SqlClient Namespacep. 518
The SqlConnection Classp. 519
Exploring the System.Data Namespacep. 528
Deciphering System.Data Naming Conventionsp. 529
Understanding the System.Data.DataSet and DataTable Objectsp. 530
To Join or Not to Join-That's The Questionp. 545
Summaryp. 547
Getting Connectedp. 549
Introductionp. 549
Connectivity Strategies-That Include Securityp. 549
Choosing a Connection Strategyp. 550
Configuring the Server and Firewallp. 552
Connection Strategiesp. 559
Connecting Just in Timep. 560
Persistent Connectionsp. 561
Understanding MARS and Its Implicationsp. 562
Choosing the Right Scope for the Connection Objectp. 563
Establishing a Connectionp. 564
Finding Servers and Instances in your Domainp. 565
Writing Code to Create Connectionsp. 568
What Is a ConnectionString?p. 569
Building a ConnectionString with the SqlConnectionStringBuilder Classp. 569
Protecting the ConnectionStringp. 571
Persisting the ConnectionStringp. 571
Building a Connection Objectp. 573
Setting the Server Name Keywordp. 578
Establishing an Alias to Your Instancep. 580
Revisiting Other Keywordsp. 581
Configuring the Connection Pool Keyword Valuesp. 584
Understanding and Managing the Connection Poolp. 585
Monitoring the Connection Poolp. 596
Keeping the Connection Pool from Overflowingp. 597
Building a ConnectionString for Other Providersp. 599
Getting Visual Studio to Build Your ConnectionStringp. 602
Opening and Closing Connections (Semi-) Automaticallyp. 607
Understanding the Connection Propertiesp. 607
Using the Connection Methodsp. 610
Handling Connection Eventsp. 617
Managing Connection Exceptionsp. 619
Sourcing Exceptionsp. 621
Understanding the SqlException Classp. 621
Dealing with Exceptionsp. 624
Summaryp. 626
Managing SqlCommand Objectsp. 627
Introductionp. 627
Creating SqlCommand Objectsp. 628
Understanding the SqlCommand Propertiesp. 628
Understanding the SqlCommand Methodsp. 636
Understanding the SqlCommand Support Functionsp. 642
Integrating Ad Hoc Queries into Your Applicationp. 646
Preventing SQL Injection Attacksp. 651
Coding Parameter Queriesp. 654
Inserting Ad Hoc Queriesp. 655
Understanding the SqlParameterCollection Classp. 657
Understanding the SqlParameter Classp. 659
Validating the Valuep. 675
Writing Code to Validate the Valuep. 677
Handling Complex Parameter Design Issuesp. 682
Understanding SqlCommand Eventsp. 686
Executing Stored Proceduresp. 686
Handling Output, Input/Output, and Return Value Parametersp. 687
Handling Rowsets with Output Parametersp. 688
Summaryp. 691
Executing SqlCommand Objectsp. 693
Introductionp. 693
Executing SqlCommand Objects Synchronouslyp. 694
Choosing the "Right" Execute Functionp. 695
CommandBehavior.SequentialAccessp. 703
CommandBehavior.SingleResult and CommandBehavior.SingleRowp. 703
Understanding the SqlDataReaderp. 704
Fetching Data from the Streamp. 705
Fetching Metadata from the SqlDataReader Streamp. 712
SqlDataReader Best Practice Designsp. 714
Populating Data Structuresp. 714
Efficient Population by Designp. 715
How Does Population Work?p. 719
Populating InfoMessage Messagesp. 720
Populating the Output and Return Value Parametersp. 721
Populating with the Data Table Load Methodp. 722
Populating Additional Resultsetsp. 724
Fetching Rows Asynchronouslyp. 729
Executing Commands Asynchronouslyp. 732
Coding the Asynchronous SqlCommand Functionsp. 733
Waiting for Godot or Your Asynchronous Operation to Completep. 738
Summaryp. 747
Managing Updatesp. 749
Introductionp. 749
Using Wizards to Generate Update Action Commandsp. 750
What the CommandBuilder Is Supposed to Dop. 751
Handling Concurrency-Update and Insert Collisionsp. 753
How the ADO.NET CommandBuilder Worksp. 756
Coding the CommandBuilderp. 757
Update Alternatives: Using the TableAdapter Configuration Wizardp. 760
Updating with the TableAdapterp. 760
Managing Generated Parametersp. 765
Complex Updates with Server-Side Logicp. 768
Using Events to Execute Your Own Update Logicp. 769
Stepping Through the UpdateEvents Examplep. 771
Managing Batch Mode Updatesp. 779
Managing Concurrency by Design or Collisionp. 782
Managing an @@Identity Crisisp. 784
Summaryp. 791
Managing Server Report Parametersp. 960
Resetting Parameter Valuesp. 965
Interesting ServerReport Parametersp. 965
Interesting ServerReport Methods and Functionsp. 966
Managing Parametersp. 967
Capturing Parametersp. 969
Report Parametersp. 975
Advanced Reporting Techniquesp. 978
Managing Click-Through Reportsp. 979
Using the SubReport Report Itemp. 985
What's in the RDLC?p. 988
Converting RDL to RDLCp. 989
Implementing the Matrix Reportp. 991
The Data Considerations for a Reportp. 991
The Initial Select Queryp. 993
Grouping the Datap. 994
Building the Matrix Reportp. 997
Summaryp. 1009
Summary and Wintry: Where We Are Nowp. 1011
Installing the Examples and Test Databasesp. 1015
Installing the Examplesp. 1015
Installing the Example Databasesp. 1016
Attaching the Example Databasesp. 1017
Establishing an Alias to Your Instancep. 1017
Chapter-Specific Configuration Issuesp. 1019
Getting Started with ADO.NETp. 1019
Managing CLR Executablesp. 1020
Summaryp. 1020
Reinstalling the DACW and Other Missing Functionality in Visual Studiop. 1021
Monitoring SQL Serverp. 1025
Monitoring SQL Server with the SQL Profilerp. 1026
Adding Filter Criteriap. 1026
Configuring SQL Profilerp. 1027
Starting the Tracep. 1029
Evaluating the Tracep. 1031
A Few SQL Profiler Tipsp. 1032
Monitoring SQL Server and ADO.NET with Performance Countersp. 1032
The ADO.NET SqlClient Performance Countersp. 1035
Summaryp. 1038
Creating and Managing Server-Side Cursorsp. 1039
Why Are Server-side Cursors Important?p. 1039
How Does ADO.NET Implement Cursors?p. 1040
How Are Server-Side Cursors Managed?p. 1041
What Do Server-Side Cursors Cost?p. 1043
How Can ADO.NET Create a Server-Side Cursor?p. 1043
Opening, Closing, and Re-opening the Connectionp. 1044
Creating the Cursorp. 1045
Fetching Data from the Cursorp. 1046
Fetching the Entire Cursorp. 1048
Updating with a Server-Side Cursorp. 1049
Summaryp. 1050
Indexp. 1051
Table of Contents provided by Ingram. All Rights Reserved.

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Excerpts

Foreword Foreword In 1992, Microsoft first launched Microsoft Access Version 1.0 as a competitor for FoxPro (which it bought), Btrieve, Paradox, PowerBuilder, and DBASE. Many think that this was Microsoft's first foray into the world of database engines. It wasn't--Microsoft introduced its first DBMS system in 1988 when it joined with Sybase and Ashton-Tate to launch its own version of SQL Server. While designed for use with OS/2, Microsoft quickly moved to leverage the considerable work they had been doing on their new NT operating system. This made the Microsoft version faster, smaller, and more competitive. It would eventually become the market leader in a very competitive DBMS industry. Microsoft's first "RAD" development tool for Windows was created in 1991 with the introduction of Visual Basic. While Visual Basic took three versions to integrate data access into its user interface, Visual Basic was not the first Microsoft BASIC language to access SQL Server. That honor goes to Quick Basic after a Microsoft developer working on the SQL Server team built his own data access interface to make it easier to access SQL Server's only published API interface, DB-Library. Again, Visual Basic has evolved into the world-class Visual Basic 6.0 and more recently Visual Basic .NET languages. Much of the success of SQL Server can be directly tied to the ability of developers at all skill levels to create data access applications that leverage SQL Server's power, scalability, and flexibility. I joined Microsoft in 1988 where I had the pleasure of serving as the first program manager for SQL Server. Our teams worked with Sybase early on and eventually helped create the Open Database Connectivity (ODBC) standard. Later in my career, we helped bring together the Visual Studio family of developer tools and drive the Win32 API, customer requirements, and product specification for the Microsoft Windows NT operating system. Since then, I have held many different roles at Microsoft and most recently have taken on the responsibility of Senior Vice President of the Server and Tools business unit that encompasses both SQL Server and the development languages. During these years, we all witnessed SQL Server's market share grow steadily from an "all other" slice to over 50% market share and Visual Basic grow to be the most popular language on the planet. However, one problem Microsoft faced throughout this evolutionary period was documentation, training, and user-education. Since the SQL Server documentation team focused its attention primarily on SQL Server, and the Visual Studio User Education team focused primarily on user interface, tools, local data, and language issues, a gap was created that only someone familiar with both disciplines could tackle. From the very earliest versions of SQL Server, while working for Microsoft University, Bill Vaughn wrote SQL Server courseware, managed and mentored SQL Server trainers, and wrote books and articles. This entire body of work was focused on helping developers understand how SQL Server and development languages like Visual Basic and Visual Basic .NET can be used to best leverage the power of SQL Server. His efforts to tie SQL Server and Visual Basic together were continued while he worked for the Visual Basic user education team and since retired from Microsoft in 2000. I first met Bill in 1988, and he was often a thorn in my team's side as he lobbied for more emphasis on SQL Server and IT data issues and better access to SQL Server's sophisticated features. It was clear that Bill was not afraid to express his opinions on how the languages and tools should be adapted to handle what he called "IT data." I guess this is because Bill had worked predominantly with very large databases at Electronic Data Systems and earlier

Rewards Program