.NET Data Access Architecture Guide.pdf

(414 KB) Pobierz
.NET Data Access
Architecture Guide
788056400.001.png
Information in this document, including URL and other Internet Web site
references, is subject to change without notice. Unless otherwise noted, the
example companies, organizations, products, domain names, e-mail addresses,
logos, people, places and events depicted herein are fictitious, and no association
with any real company, organization, product, domain name, e-mail address, logo,
person, place or event is intended or should be inferred. Complying with all
applicable copyright laws is the responsibility of the user. Without limiting the
rights under copyright, no part of this document may be reproduced, stored in or
introduced into a retrieval system, or transmitted in any form or by any means
(electronic, mechanical, photocopying, recording, or otherwise), or for any
purpose, without the express written permission of Microsoft Corporation.
Microsoft, ActiveX, Microsoft Press, Visual Basic, Visual Studio, and Windows are
either registered trademarks or trademarks of Microsoft Corporation in the United
States and/or other countries.
© 2003 Microsoft Corporation. All rights reserved.
Version 1.0
The names of actual companies and products mentioned herein may be the
trademarks of their respective owners.
Contents
.NET Data Access Architecture Guide
iv
Contents
How to Use a Stored Procedure Output or Return Parameter
to Retrieve a Single Item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
.NET Data Access
Architecture Guide
Introduction
If you are designing a data access layer for a .NET-based application, you should use
Microsoft® ADO.NET as the data access model. ADO.NET is feature rich and
supports the data access requirements of loosely coupled, multitier Web applications
and Web services. As with other feature-rich object models, ADO.NET offers a
number of ways to solve a particular problem.
The .NET Data Access Architecture Guide provides information to help you choose
the most appropriate data access approach. It does this by describing a wide range
of common data access scenarios, providing performance tips, and prescribing best
practices. This guide also provides answers to frequently asked questions, such as:
Where is the best place to store database connection strings? How should I
implement connection pooling? How should I work with transactions? How should
I implement paging to allow users to scroll through large numbers of records?
This guide focuses on the use of ADO.NET to access Microsoft SQL Server™ 2000 by
using the SQL Server .NET data provider, one of the two providers shipped with
ADO.NET. Where appropriate, this guide highlights any differences that you need
to be aware of when you use the OLE DB .NET data provider to access other OLE
DB–aware data sources.
For a concrete implementation of a data access component developed using the
guidelines and best practices discussed in this document, see the Data Access
Application Block. The Data Access Application Block includes the source code for
the implementation, and you can use that code directly in your .NET-based
applications.
The .NET Data Access Architecture Guide includes the following sections:
Introducing ADO.NET
Managing Database Connections
Error Handling
Performance
Connecting Through Firewalls
Handling BLOBs
Zgłoś jeśli naruszono regulamin