Download presentation
Presentation is loading. Please wait.
Published bySophia Green Modified over 9 years ago
1
Introduction to Database Development Using Borland Data Providers 2128 Martin Rudy
2
Agenda –BDP Architecture Overview –BDP Components –Connection to data –Using the Data Explorer –Updating data / Transactions –Master / Detail –Dynamic Queries –Migrating to BDP –Data resolving
3
Additional BDP Sessions Mon 2186 Building Database Applications with ADO.NET 3188 ASP.NET Web Forms and Databases Tue 2106 The ADO.NET DataSet In-depth Wed 4100 Integrating into the Borland Data Provider 3188 ASP.NET Web Forms and Databases 3116 Top 10 Techniques for Microsoft.NET DB Dev
5
BDP Architecture Overview –Implementation for ADO.NET Data Provider interfaces –Includes set of component designers –Live data –Adds following extensions: metadata retrival schema creation
6
Supported Databases –ORACLE 9.1.2, 8.1.5 –Microsoft SQL Server 2000 –MSDE –Access –InterBase 7.x –Sybase 12.5
7
BDP Components
8
DataSet
9
New in Diamondback –BdpCopyTable Copy table data and PK –Data Resolving DataHub DataSync –Data Remoting RemoteConnection RemoteServer
10
Connecting to data –Place a BdpConnection component –Set connection parameters –Place a BdpDataAdapter and define SQL statements –Create a dataset –Activate BdpDataAdapter –Place a data aware control and connection to dataset
11
Code Demo Connecting to data
12
Using the Data Explorer –Tool to browse databases –Establish named connections –Display table schemas, stored procs, views –Modify data – update and rollback option –Alter, drop, copy, paste table –SQL Window –Data migration –Available outside IDE
13
Code Demo Using the Data Explorer
14
Data updating basics –Two BdpDataAdapter methods: Update AutoUpdate –BdpCommandBuilder Developer handled updates
15
Code Demo Data updating basics
16
Column Properties –Properties for each column –Like TField properties –Use Tables property on DataSet –Displays Table Collections Editor –Select Columns property –Display Columns Collections Editor
17
Code Demo Column Properties
18
Transactions –BdpTransaction Commit Rollback –Create instance of BdpTransaction –BeginTransaction from connection
19
Code Demo Transactions
20
Master / Detail –Need two BdpDataAdapter components –Create SQL for master and detail –Populate same dataset –Activate both adapters –Modify dataset Relations property Use Relations Collection Editor Define Parent and Child tables –Detail DataMember property use relationship name
21
Code Demo Master / Detail
22
Dynamic Queries –Specify SQL in BdpDataAdapter –Use ? for parameter place holder –Modify BdpDataDataAdaper SelectCommand property –Use Parameters property to display BdpParameter CollectionEditor to define parameters –Assign parameter value as follows: BdpSelectCommand1.Parameters['cntry'].Value
23
Code Demo Dynamic Queries
24
Migrating to BDP Components ConnectionBdpConnection DataSetProvider (DSP)BdpDataAdapter BdpDataHub/BdpDataSync ClientDataSet (CDS)DataSet TransDesc, IBTransactionBdpTransaction
25
Migrating to BDP Events DSP.BeforeUpdateRecord DSP.AfterUpdateRecord BdpDataAdapter.RowUpdating BdpDataAdapter.RowUpdated DataSet.BeforePost DataSet.AfterPost DataSet.Tables RowChanging DataSet.Tables RowChanged DataSet.BeforeDelete DataSet.AfterDelete DataSet.Tables RowDeleting DataSet.Tables RowDeleted TField.OnValidateDataSet.Tables ColumnChanging DataSet.Tables ColumnChanged
26
Migrating to BDP Methods CDS.ApplyUpdatesBdpDataAdapter.AutoUpdate CDS.DeltaDataSet/Tables GetChanges CDS.CancelUpdatesDataSet/Tables RejectChanges CDS.ChangeCount > 0DataSet.HasChanges CDS.CloneCursorDataSet/Tables Clone CDS.EmptyDataSetDataSet/Tables Clear CDS.LoadFromFile(xml)DataSet.ReadXml CDS.WriteToFile(xml)DataSet.WriteXml CDS.MergeChangeLogDataSet/Tables AcceptChanges
27
Migration to BDP Properties DSP.UpdateModeBdpUpdateMode (All, Key, Changed) DataSet.StateDataSet.Tables Rows RowState EOF/BOFNone – need to use DataRow TField propertiesDataSet ColumnCollection
28
Code Demo Migrating to BDP
29
Data Resolving –DataHub Client side cache for DataSet From any IDataProvider –DataSync holds a collection of DataProviders BDP and non-BDP Optimal SQL generation for BDP Uses CommandBuilder for non BDP providers –Similar to TDataSetProvider Error dataset not returned Integrated into dataset
30
Introduction to Database Development Using Borland Data Providers Martin Rudy 2128 Q & A
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.