Advanced ADO

Information about Advanced ADO

Published on June 16, 2007

Author: Me_I

Source: authorstream.com

Content

Advanced ADO.NET Techniques:  Advanced ADO.NET Techniques Jackie Goldstein Renaissance Computer Systems Ltd. MSDN Regional Director, Israel [email protected] Prerequisites for presentation: I assume you know: 1) Visual Basic.NET 2) ADO.NET Level: Advanced ## Jackie Goldstein…:  Jackie Goldstein… General Manager of Renaissance Computer Systems Consulting, Training, andamp; Development, with Microsoft Tools andamp; Technologies Author of 'Database Access with Visual Basic.Net' (ISBN 0-67232-3435, Addison-Wesley) MSDN Regional Director for Israel Founder and monthly host of IVBUG (Israel Visual Basic User Group) Speaker at local andamp; international developer conferences: Microsoft Developer Days, TechEd, VSLive!, VBITS, VB DevCon, SQL2TheMax Selected as SME (Subject Matter Expert) to help develop/review content for DevDays with Microsoft team in Redmond Session Topics:  Session Topics 'Love Will Keep Us Together' Multi-Table Reads and Updates 'My Way' Specifying DataSet XML Format 'We Can Work it Out' Concurrency Conflicts 'Stop in the Name of Love' Pessimistic Locking Questions and Summary Data In The .NET Platform:  Data In The .NET Platform “Love Will Keep Us Together”Multi-Table Reads and Updates:  'Love Will Keep Us Together' Multi-Table Reads and Updates How do I do multi-table reads and updates ? The standard methods of generating update command for the DataAdapter (CommandBuilder and DataAdapter Configuration Wizard) support only single-table updates “Love Will Keep Us Together”Multi-Table Reads and Updates:  'Love Will Keep Us Together' Multi-Table Reads and Updates Use Batch SQL / Stored Procedures to load multiple DataSet tables in one server round-trip Use ExecuteXmlReader to fetch hierarchical data and load into DataSet Update multiple tables using a Stored Procedure Issue multiple update commands by calling the Update methods of the individual DataAdapters “Love Will Keep Us Together”Multi-Table Reads and Updates:  'Love Will Keep Us Together' Multi-Table Reads and Updates Generally update related tables in the following order: Child Table: Delete Records Parent Table: Insert, Update, and Delete records Child Table: Insert and Update records “Love Will Keep Us Together”Multi-Table Reads and Updates:  'Love Will Keep Us Together' Multi-Table Reads and Updates Read multiple tables into the DataSet in a single round-trip to the database server Update the database with changes to multiple tables Demo! “My Way”The DataSet And XML :  'My Way' The DataSet And XML The DataSet Load/save XML data into/out of DataSet Schema can be loaded/saved as XSD Schema can be inferred from XML Data The DataSet can be associated with an XmlDataDocument Exposes a relational view over structured XML According to the DataSet schema Allows strong typing, control binding, and relational access of XML data Preserves full fidelity of XML Document Simultaneously exposes data relationally or as XML Multiple tools on same data “My Way”Controlling how XML is Generated:  'My Way' Controlling how XML is Generated DataSet lets you control how XML is generated Name, Namespace properties on DataSet, DataTable, DataColumn MappingType property on DataColumn defines how data is written Element, Attribute, SimpleType, Hidden Nested Property on DataRelation controls how children are written “My Way Specifying DataSet XML Format:  'My Way Specifying DataSet XML Format Set DataSet properties to specify custom format of exposed XML Demo! “We Can Work it Out”Concurrency Conflicts:  'We Can Work it Out' Concurrency Conflicts Why Optimistic Locking ? Conflict Detection Conflict Resolution DataSet maintains 3 views of field value: Original Current Proposed (during edit) Can force changes, reject changes, or reject changes and reload data from source What defines a conflict ?:  What defines a conflict ? ADO 2.X – Dynamic Property 'Update Criteria' adCriteriaUpdCols (default) adCriteriaAllCols adCriteriaTimeStamp adCriteriaKey ADO.NET Auto-generated commands include PK and all fields in UPDATE and DELETE statements Developer can specify own custom SQL statements (e.g. if 2 of the 5 columns were modified). Differences in ADO.NET:  Differences in ADO.NET Can be automatically generated (but with limitations) Greater flexibility in defining what constitutes a conflict (see previous slide) A little more manual code required Passing different versions of columns Retrieving current database values More flexibility in handling batches with one or more conflicts “We Can Work it Out”Concurrency Conflicts:  'We Can Work it Out' Concurrency Conflicts Detecting and resolving concurrency conflicts using the DataAdapter Configuration Wizard Demo! “Stop in the Name of Love”Pessimistic Locking:  'Stop in the Name of Love' Pessimistic Locking Locking records when read ensures updates don't fail due to concurrency violations Kills scalability of application! Can still use ADO 'classic' (2.X) Supported in ADO.NET through transactions Update records in same transaction as read “Stop in the Name of Love”Pessimistic Locking:  'Stop in the Name of Love' Pessimistic Locking Use ADO.NET Transactions to cause pessimistic locking Updates outside the transaction are blocked until transaction completes Demo! “Sooner or Later”Specifying Metadata at Design Time:  Issue: Extra server roundtrips to gather metadata leads to poor performing, less predictable code Solution: Specify MetaData at DesignTime when known DataReader Strongly Typed Ordinal accessors Str = dr.GetString(0) DataSet Load, don't infer, schema Specify appropriate XmlReadMode Data Adapter Specify insert/update/delete commands Versus CommandBuilder when known Specify Parameter information Versus CommandBuilder.DerviveParameters Specify Primary Key information Versus MissingSchemaAction.AddWithKey 'Sooner or Later' Specifying Metadata at Design Time Summary:  Summary Design and implementation of multi-table DataSets require a little extra thought and care .NET Framework provides extensive support for XML and allows configurable access and manipulation of both relational and XML data Conflict Detection is achieved by adding a WHERE clause to UPDATE and DELETE statements It is still possible to utilize pessimistic locking Titles and Artists:  Titles and Artists 'Love Will Keep Us Together' The Captain andamp; Tennille 'My Way' Frank Sinatra 'We Can Work it Out' The Beatles 'Stop in the Name of Love' Diana Ross and the Supremes Questions?:  Questions?

Related presentations


Other presentations created by Me_I

body language
15. 06. 2007
0 views

body language

Pregnant Man Delivers Baby Girl
06. 07. 2008
0 views

Pregnant Man Delivers Baby Girl

Pregnant Man delivers baby girl
04. 07. 2008
0 views

Pregnant Man delivers baby girl

Interview guide
22. 04. 2008
0 views

Interview guide

Price
17. 04. 2008
0 views

Price

valuation models
17. 04. 2008
0 views

valuation models

Stan Mcmillen
14. 04. 2008
0 views

Stan Mcmillen

ABch11
13. 04. 2008
0 views

ABch11

IPStrategy mozambique
10. 04. 2008
0 views

IPStrategy mozambique

magaddinometrans01
09. 04. 2008
0 views

magaddinometrans01

lecture7 07 time cmp
07. 04. 2008
0 views

lecture7 07 time cmp

Easter
09. 07. 2007
0 views

Easter

PHSC1013 Reactions
02. 01. 2008
0 views

PHSC1013 Reactions

Digestive System Disorders
26. 03. 2008
0 views

Digestive System Disorders

ABC on HIV AIDS
16. 06. 2007
0 views

ABC on HIV AIDS

plateau
09. 07. 2007
0 views

plateau

4 YCCC 1500 Competition K1IR
16. 06. 2007
0 views

4 YCCC 1500 Competition K1IR

2DShapes
16. 06. 2007
0 views

2DShapes

Analyzing Political Cartoons 1
15. 06. 2007
0 views

Analyzing Political Cartoons 1

kwanza
09. 07. 2007
0 views

kwanza

7 passions
16. 06. 2007
0 views

7 passions

GreekDrama
09. 07. 2007
0 views

GreekDrama

L9medicine
12. 10. 2007
0 views

L9medicine

Business opportunities 2005
18. 10. 2007
0 views

Business opportunities 2005

Rocio Guirao Diaz
03. 09. 2007
0 views

Rocio Guirao Diaz

Jorge Tellez Fuentes
22. 10. 2007
0 views

Jorge Tellez Fuentes

87 81
22. 10. 2007
0 views

87 81

Active Aging Steps
27. 11. 2007
0 views

Active Aging Steps

Yafei ECG poster final
15. 11. 2007
0 views

Yafei ECG poster final

NACAA Conference FSEP
29. 12. 2007
0 views

NACAA Conference FSEP

chem 101 chapter 6 slides
04. 01. 2008
0 views

chem 101 chapter 6 slides

comp intel
03. 10. 2007
0 views

comp intel

03n 0203 ts00002 LEACH
19. 11. 2007
0 views

03n 0203 ts00002 LEACH

mikelle
28. 12. 2007
0 views

mikelle

Dear God
03. 10. 2007
0 views

Dear God

Team Leader Training 12 11 06
09. 07. 2007
0 views

Team Leader Training 12 11 06

Schneider and Schmitt
09. 07. 2007
0 views

Schneider and Schmitt

paraguay
09. 07. 2007
0 views

paraguay

mowbjan06
09. 07. 2007
0 views

mowbjan06

mlk 2
09. 07. 2007
0 views

mlk 2

Mayan Cosmology
09. 07. 2007
0 views

Mayan Cosmology

GCSE ART D of Dead
09. 07. 2007
0 views

GCSE ART D of Dead

Enter the 2007 Art Comp1
09. 07. 2007
0 views

Enter the 2007 Art Comp1

cases
24. 02. 2008
0 views

cases

a032405
09. 10. 2007
0 views

a032405

sfa ch2
01. 01. 2008
0 views

sfa ch2

6 12USAITAsecondpanel
22. 10. 2007
0 views

6 12USAITAsecondpanel

Gatekeepers 6
11. 12. 2007
0 views

Gatekeepers 6

EU New Member States Brno NA
18. 03. 2008
0 views

EU New Member States Brno NA

Rym Kefi
05. 01. 2008
0 views

Rym Kefi

Chinese Dynasties
25. 03. 2008
0 views

Chinese Dynasties

2 4 Adams Hallam
07. 10. 2007
0 views

2 4 Adams Hallam

Wings of the Centennial
09. 07. 2007
0 views

Wings of the Centennial

Creating a User Group 2005
30. 03. 2008
0 views

Creating a User Group 2005

Observation
09. 07. 2007
0 views

Observation

usingmypyramidadult
04. 03. 2008
0 views

usingmypyramidadult

Stefan Stanciugelu
15. 10. 2007
0 views

Stefan Stanciugelu

carreira
19. 06. 2007
0 views

carreira

Capitalization Part 2
19. 06. 2007
0 views

Capitalization Part 2

Caceres 2007
19. 06. 2007
0 views

Caceres 2007

CHETEMPOFA
18. 06. 2007
0 views

CHETEMPOFA

cervantes
18. 06. 2007
0 views

cervantes

CEIS 23 06
18. 06. 2007
0 views

CEIS 23 06

cartoon classics
18. 06. 2007
0 views

cartoon classics

cardiac2
19. 06. 2007
0 views

cardiac2

hphennalect
09. 07. 2007
0 views

hphennalect

Current Presentation March06
18. 06. 2007
0 views

Current Presentation March06

cul 18
18. 06. 2007
0 views

cul 18

competitive rviews
18. 06. 2007
0 views

competitive rviews

company wbc
18. 06. 2007
0 views

company wbc

City Guide Mobile web en
18. 06. 2007
0 views

City Guide Mobile web en

MICROIII Aula11
14. 11. 2007
0 views

MICROIII Aula11

comunicado2
22. 10. 2007
0 views

comunicado2

Camilla Schreiner UiO
19. 06. 2007
0 views

Camilla Schreiner UiO

verb som laanord
27. 09. 2007
0 views

verb som laanord

LCWS05 gao 1
12. 10. 2007
0 views

LCWS05 gao 1

ambiguity
16. 06. 2007
0 views

ambiguity

all about burgers 1
16. 06. 2007
0 views

all about burgers 1

AGME 1
16. 06. 2007
0 views

AGME 1

adolposter winkles
16. 06. 2007
0 views

adolposter winkles

AbrahamseOverviewAM
16. 06. 2007
0 views

AbrahamseOverviewAM

31 Presentation
16. 06. 2007
0 views

31 Presentation

303lec09
16. 06. 2007
0 views

303lec09

04 06 training
15. 06. 2007
0 views

04 06 training

Brian PM FINAL
15. 06. 2007
0 views

Brian PM FINAL

Berkeley ISSC Feb 07
15. 06. 2007
0 views

Berkeley ISSC Feb 07

Autism 06 BU handout
15. 06. 2007
0 views

Autism 06 BU handout

Attraction
15. 06. 2007
0 views

Attraction

Asali
15. 06. 2007
0 views

Asali

April Showers
15. 06. 2007
0 views

April Showers

APA San Diego
15. 06. 2007
0 views

APA San Diego

ap05blogs
15. 06. 2007
0 views

ap05blogs

anastasatos
15. 06. 2007
0 views

anastasatos

Analyzing Political Cartoons
15. 06. 2007
0 views

Analyzing Political Cartoons

analyzing cartoons incent asia
15. 06. 2007
0 views

analyzing cartoons incent asia

africanamericanhumor
16. 06. 2007
0 views

africanamericanhumor

americanpoplanguage
15. 06. 2007
0 views

americanpoplanguage

mainmenu2007changes jml
06. 03. 2008
0 views

mainmenu2007changes jml

StephenAbram RecreatingServices3
10. 03. 2008
0 views

StephenAbram RecreatingServices3

Joanna Krupa
03. 09. 2007
0 views

Joanna Krupa

HowtheWestWasWon
19. 02. 2008
0 views

HowtheWestWasWon

accidental humor
16. 06. 2007
0 views

accidental humor

keyes
03. 01. 2008
0 views

keyes

VolkswagenCoaching
16. 11. 2007
0 views

VolkswagenCoaching

07 kauai1
26. 02. 2008
0 views

07 kauai1

Urban Waters and Ports html
30. 12. 2007
0 views

Urban Waters and Ports html

awakening
15. 06. 2007
0 views

awakening

RR11 NIA Hodes
03. 01. 2008
0 views

RR11 NIA Hodes

AAAR diesel1
29. 02. 2008
0 views

AAAR diesel1

RSS AnnualMtg3
29. 09. 2007
0 views

RSS AnnualMtg3

USTC
29. 11. 2007
0 views

USTC

ESS Adv Plan Present 4 18
09. 07. 2007
0 views

ESS Adv Plan Present 4 18

CMR0101
18. 06. 2007
0 views

CMR0101