1 / 22

Poll: What .NET development language are you using (or plan ...

Poll: What .NET development language are you using (or plan. [Live Meeting Multiple Choice Poll. Use Live Meeting > Edit Slide Properties... to edit.] Delphi.NET VB.NET C#.NET Other Don't know. using Advantage with ADO.NET. preview. standard ADO.NET data access techniques

sarah
Download Presentation

Poll: What .NET development language are you using (or plan ...

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Poll: What .NET development language are you using (or plan ... • [Live Meeting Multiple Choice Poll. Use Live Meeting > Edit Slide Properties... to edit.] • Delphi.NET • VB.NET • C#.NET • Other • Don't know

  2. using Advantage with ADO.NET

  3. preview • standard ADO.NET data access techniques • AdsExtendedReader functionality • 4 samples in C#, VB.NET and Delphi.NET • standard components • AdsExtendedReader • seeks • record locking

  4. .net data model

  5. .net design issues • limit large data reads and writes between client and server. • concurrency issues • data freshness

  6. example #1: classic ADO.NET • AdsConnection: cn.ConnectionString = "data source = ..\\..\\data; servertype = REMOTE |LOCAL"; • AdsCommand SelectCmd = cn.CreateCommand(); SelectCmd.CommandText = "SELECT * FROM websites order by image_name"; da.SelectCommand = SelectCmd; • AdsCommandBuilder cb = new AdsCommandBuilder(da); • AdsDataAdapter da.Fill(ds, "websites");

  7. Poll: Are you developing in .NET now? • [Live Meeting Yes/No Poll. Use Live Meeting > Edit Slide Properties... to edit.] • Yes • No

  8. View/Application Share: example#1: BlobSample_DataSet • [Live Meeting View/Application Share. Use Live Meeting > Edit Slide Properties... to edit.]

  9. DataReader vs. DataSet • use DataReader if -- • do not need to cache data • processing large results too large to fit in memory • need to access data once, in a forward-only and read-only manner • conn.Open(); cmd = conn.CreateCommand(); cmd.CommandText = "select * from departments"; reader = cmd.ExecuteReader(); while ( reader.Read() ) { for ( iField = 0; iField < reader.FieldCount; iField++ ) Console.Write( reader.GetValue(iField) + " "); Console.WriteLine(); }

  10. a better tool • AdsExtendedReader • allows record-level access to server-side data • set filters, set index orders, seek to specific records, lock records, re-index, set bookmarks, zap tables, copy tables, create indexes, read and write to fields, set ranges • bi-directional

  11. Poll: Have you ever used the Advantage .NET Data Provider? • [Live Meeting Yes/No Poll. Use Live Meeting > Edit Slide Properties... to edit.] • Yes • No

  12. example #2: AdsDataAdapter and AdsExtendedReader • Execute AdsExtendedReader: rdr = cmd.ExecuteExtendedReader(CommandBehavior.SequentialAccess) • Set the index order: rdr.ActiveIndex = "Image_PK“ • Seek: rdr.Seek(New Object() {UCase(tbSearch.Text)}, _ seektype).ToString • Read Fields: iFieldNum = rdr.GetOrdinal("Image_File") BLOBData = rdr.GetBytes(iFieldNum)

  13. View/Application Share: example#2: BlobSample_DataReader • [Live Meeting View/Application Share. Use Live Meeting > Edit Slide Properties... to edit.]

  14. example #3: AdsExtendedReader • SeekTypes • SoftSeek: Allows record to be found with the next higher key value if the given key does not exist. • HardSeek: Seeks an exact match. • SeekLast: Seeks for the last value in an index. • SeekGt (Greater Than): Seeks for the last value in the index. • Partial Match • Allows partial matching of seek value. For example, a seek on a last name index with a value of “Smit” would fail to find “Smith” if Partial is false, but succeed if PartialMatch is true.

  15. View/Application Share: example#3: Seek Example • [Live Meeting View/Application Share. Use Live Meeting > Edit Slide Properties... to edit.]

  16. example #4: AdsExtendedReader and record locking • Concurrency issues • Last write wins • Data versioning algorithm • Record Locking rdrEditUser2 := cmdEditUser2.ExecuteExtendedReader; rdrEditUser2.ActiveIndex := 'customer id'; rdrEditUser2.Seek([Int16.Parse(tbCustID.Text)], AdsExtendedReader.SeekType.SoftSeek); rdrEditUser2.LockRecord;

  17. View/Application Share: example#4: Recording Locking • [Live Meeting View/Application Share. Use Live Meeting > Edit Slide Properties... to edit.]

  18. build a better application • install peer-to-peer database by moving a data directory • client application includes 4 DLL’s • free local server DLL • download and install application over internet with no end-user setup. • low maintenance, hands-off install for scalable client-server database • runs as service • no code change required • 5 to 1000 users

  19. summary • Advantage .Net Data Provider • Connection, AdsDataAdapter, DataReader, AdsCommand • AdsExtendedReader • advanced functionality • beyond standard .net data model • distinct advantage • better tools • better design • easy install and maintenance

  20. questions??

  21. Advantage Database Server: The Official Guide (ISBN 0-07-223084-3) is a new book, written by Cary Jensen and Loy Anderson and published by McGraw-Hill/Osborne Media Group, that systematically guides a developer through key functionality of Advantage and includes a Companion CD with code samples and a single-user license of Advantage Database Server version 7.0. http://www.extendedsystems.com/ADS/ADS+Book+Promo.htm

More Related