The-Best-of-Simple-Talk

Only available on StudyMode
  • Download(s) : 109
  • Published : December 24, 2012
Open Document
Text Preview
The Best of Simple Talk

Jit ‘n’ Run
Vol.2

The Best of Simple Talk - .NET

In association with

ISBN: 978-1-906434-12-0 Shelving: Development/Computer Science

www.simpletalkpublishing.com

i

JIT N' Run v2

The Best of Simple-Talk .NET

by Amir thalingam Prasanna, Ben Hall, Brian Donahue, Damon Armstrong, Francis Nor ton, James Moore, Jef f Hewitt, Jesse Liber ty, John Papa, Mike Bloise and Tilman Bregler, First published 2008 by Simple-Talk Publishing

ii

Copyright Amirthalingam Prasanna, Ben Hall, Brian Donahue, Damon Armstrong, Francis Norton, James Moore, Jeff Hewitt, Jesse Liberty, John Papa, Mike Bloise and Tilman Bregler 2008 ISBN 978-1-906434-12-0 The right of Amirthalingam Prasanna, Ben Hall, Brian Donahue, Damon Armstrong, Francis Norton, James Moore, Jeff Hewitt, Jesse Liberty, John Papa, Mike Bloise and Tilman Bregler to be identified as the author of this work has been asserted by him in accordance with the Copyright, Designs and Patents Act 1988 All rights reserved. No part of this publication may be reproduced, stored or introduced into a retrieval system, or transmitted, in any form, or by any means (electronic, mechanical, photocopying, recording or otherwise) without the prior written consent of the publisher. Any person who does any unauthorised act in relation to this publication may be liable to criminal prosecution and civil claims for damages. This book is sold subject to the condition that it shall not, by way of trade or otherwise, be lent, re-sold, hired out, or otherwise circulated without the publisher’s prior consent in any form other than which it is published and without a similar condition including this condition being imposed on the subsequent publisher. Typeset by Andrew Clarke and Chris Massey

iii

CONTENTS
Contents............................................................................................................................................................3 About the Authors ..........................................................................................................................................7 acknowledgements ..........................................................................................................................................9 Introduction .....................................................................................................................................................9 NET Application Architecture: the Data Access Layer..........................................................................11 Designing and building a robust data access layer..................................................................11 Layered design and the data access layer..............................................................................11 Design principals in the data access layer ............................................................................14 Exchanging Data with the DAL............................................................................................14 Putting theory into practice: the demo application ............................................................17 NET Application Architecture: Logging SQL Exceptions in the Data Access Layer.......................19 Managing SQL exceptions in .NET applications ...................................................................19 The real-world scenario ..........................................................................................................19 Solution architecture: objectives and overview...................................................................20 Building the SQL statement logger ......................................................................................22 The code in action: demo application ..................................................................................35 Conclusion...
tracking img