Download presentation
Presentation is loading. Please wait.
Published byNathaniel Underwood Modified over 6 years ago
1
6/12/2018 5:09 AM © 2004 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
2
Data in the Windows Mobile World
6/12/2018 5:09 AM Data in the Windows Mobile World Dr. Peter Stanski CEO & Enterprise Solution Architect (Software & Infrastructure) Microsoft Solution Architect MVP Microsoft Certified Solution Architect (MCA) Founding Member of Stanski Consulting Pty Ltd peter.stanski –at – stanski.com Blog: © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
3
Agenda Setting the Scene Rolling your Own Solutions
6/12/2018 5:09 AM Agenda Setting the Scene Rolling your Own Solutions Using the Framework & Database Features Demos © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
4
Web Service Credentials
6/12/2018 5:09 AM What Are We Focusing on? Mobile Device User Experience Business Logic Data and Web Svc User Experience Management CAB Views WinForms CAB Extensions for Mobile Logging Presenters Deployment VS.NET Configuration Mobile Designer Business Logic Form Factor Dot Density (DPI) Orientation Business Entities Business Logic Controllers Business Workflows Security Web Service Credentials Gateway Authorization Staging DB Data Synchronization Occasionally Connected Web Services Connectivity Business Data Configuration Data Deployment Data Managing Connection Managing Subscriptions Queues Physical Addresses Web Services Business Transactions Logging Admin Console Replication Web Services Calls YOU ARE HERE © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
5
“What is Most Important to Your Project?”
6/12/2018 5:09 AM “What is Most Important to Your Project?” Size Performance Security Data integrity Ease of development Ease of data transfer Platform support Wireless connectivity © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
6
The Agility of your Solution
6/12/2018 5:09 AM The Agility of your Solution © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
7
Rolling Your Own Data Solutions
6/12/2018 5:09 AM Rolling Your Own Data Solutions Data Communication Channels (already covered) Data Architecture (eg shaping your data structures) Handling your Data on and between Devices Copying/Moving/Replicating Synchronizing Conflict Resolutions © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
8
Lessons Learned: Code & Data
6/12/2018 5:09 AM Lessons Learned: Code & Data It’s always about the data – DATA is KING Code always occupies less space than data Data Structures impact the overall performance © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
9
Your Data Approach Options
6/12/2018 5:09 AM Your Data Approach Options Plain Text File E.g. any free text content Simple Structured Flat Text File Variable & Fixed record width – eg. CSV, .ini, .inf Highly (typed schema) Structured Flat Text E.g. XML, XSD, xHTML, RSS Simple Structured Binary File E.g. basic binary content – GIF, VOC, BMP, RAW Highly (typed schema) Structured Binary File E.g. Binary Serialized Object (.bin) or DataBase (.sdf) © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
10
CSV Text Driver A simple Structured Flat Text File Library
6/12/2018 5:09 AM CSV Text Driver A simple Structured Flat Text File Library CSVDataAdapter behaves like any other adapter: Fill() - reads CSV file and returns a DataSet() Update() – writes a DataSet to disk Performance Issue: Data updates overwrite the entire file each time Download it from here: © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
11
Pocket Outlook Uses Pocket Outlook Object Model (POOM)
6/12/2018 5:09 AM Pocket Outlook Uses Pocket Outlook Object Model (POOM) Provides access to item synchronized through ActiveSync (to server or desktop) CF v2 has improved support for COM interop Windows Mobile 5 – has POOM API Microsoft.WindowsMobile class library © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
12
Example - POOM WM v5 using Microsoft.WindowsMobile.PocketOutlook;
OutlookSession outlookSession; private void Form1_Load(object sender, EventArgs e) { outlookSession = new OutlookSession(); ContactFolder contactFolder = outlookSession.Contacts; foreach (Contact contact in contactFolder.Items) { string name = contact.FirstName + " "+ contact.LastName; listBox1.Items.Add(name); } private void Form1_Closing(object sender, CancelEventArgs e) { outlookSession.Dispose(); © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
13
Data Replication Challenges
6/12/2018 5:09 AM Data Replication Challenges Copying, Moving & Replicating Concurrency Data changing on client, server, or both Conflict resolution Connectivity Reliability Bandwidth Security/Firewalls Deployment and Administration © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
14
Data Replication Models Goals
6/12/2018 5:09 AM Data Replication Models Goals Device (terminal) Independence Allows end users to change devices and still access the data source Simplify development of synchronization logic Reliable conflict resolution Share a common data source Allow multiple connections to the same data source © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
15
Dealing with Large File Replication
6/12/2018 5:09 AM Dealing with Large File Replication POP Quiz Challenge: Connected to Internet via GPRS Wanting to use Web Services for communication You have a large data file on your device You have a large data file on your server You want to synchronize the files You are not allowed to copy the whole file! What Synchronization scheme are you applying? © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
16
Replication Scheme Options
6/12/2018 5:09 AM Replication Scheme Options Answer: Send “delta” changes between server/device But “How do you know the change deltas”? (A) Keep a change log associated with file Need an Index and a change timestamp attribute (send the log file) Easy when one way replicating changes to server Can support data rollback Complex when two way replicating – conflict resolution required (B) Track file block level changes Only send the file block areas that have changed Perform CRC check for file, every table, record and field to narrow scope May need an Index and a change timestamp attribute (internal to file records) (C) Use both schemes for maximum benefit © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
17
Sending File Block Deltas
6/12/2018 5:09 AM Sending File Block Deltas Send All CRCs CRC #1 CRC #3 CRC #2 CRC #7 CRC #6 CRC #5 CRC #4 CRC #1 CRC #3 CRC #2 CRC #7 CRC #6 CRC #5 CRC #4 Request Non Matching CRC regions Send all requested CRC region blocks VERY LARGE FILE VERY LARGE FILE Confirm Successful Completion ACK © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
18
Resolving Conflicts Two Options: Automated:
6/12/2018 5:09 AM Resolving Conflicts Two Options: Automated – usually performed silently by system User Controlled – usually requires a user to resolve Automated: Controlled by Policies – eg “Always overwrite device” Intelligent – change Flag or Timestamp driven Device Flag/GUID/ Counter/ TimeStamp Server Flag/GUID/ Counter/ TimeStamp Data Stuff in Here © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
19
For those that stand on the shoulders of others….
6/12/2018 5:09 AM The Database Approach For those that stand on the shoulders of others…. © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
20
SQL Server CE/Mobile Data Access
6/12/2018 5:09 AM SQL Server CE/Mobile Data Access Native Stack Managed Stack eVC/VS 2005 (C++) VB.NET & C# ADO.NET SQL Server CE Data Provider OLEDB CE CLR / .NET CF OLEDB Provider QP / Cursor Engine Storage Engine / Replication Tracking © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
21
CE Data Access Storage Architecture
6/12/2018 5:09 AM CE Data Access Storage Architecture Managed Stack Enterprise Backend Oracle / db2 / etc Native Stack VS 2005 (VB 2005 & C#) eVB 3.0 eVC 3.0 ADO.NET Ethernet SQL Server Mobile Data Provider SQL Server Client Data Provider TDS ADO CE v3.1 CLR / .NET CF Well Connected OLEDB CE OLEDB / Replication API 802.11b/a/g, CDPD, GSM, GPRS, CDMA, TDMA, etc. SQL CE Edition/Mobile TDS – tabular data stream Data Provider IIS Server Agent: Replication and Remote Data Access OLEDB Client Agent: Merge Replication and RDA QP/Cursor Engine OLEDB HTTP Storage Engine / Replication Tracking Occasionally Connected CLIENT SERVER © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
22
Database Replication Models
6/12/2018 5:09 AM Database Replication Models Use SQL CE/Mobile (Everywhere) Editions Remote Data Access (RDA) SQL Mobile-driven PULL and PUSH model Change tracking with optimistic concurrency Merge Replication Publisher - Subscriber Model - Microsoft SQL Server 2000+) Advanced tracking and conflict resolution Centralized Control over Publishers and Subscribers © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
23
Remote Data Access (RDA)
6/12/2018 5:09 AM Remote Data Access (RDA) Loosely coupled connectivity between SQL Server Mobile and SQL Server Talks to SQL Server without being “connected” Stores SQL Server query results directly in SQL Server Mobile Optionally tracks changes locally Sends locally changed records back to SQL Server .NET Compact Framework provides managed wrapper SqlCeRemoteDataAccess © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
24
Remote Data Access Architecture
6/12/2018 5:09 AM Remote Data Access Architecture Application SQL Mobile Client Agent SQL Mobile Server Agent SQL Server OLE DB Storage Engine - Common Tracking IIS Box SQL Server Database SQL Mobile Database © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
25
Remote Data Access Using SqlCeRemoteDataAccess
6/12/2018 5:09 AM Remote Data Access Using SqlCeRemoteDataAccess Each program must specify RDA connectivity Local database information (SQL Mobile Edition OLE DB connection string) Web server information URL – Must include sqlcesa30.dll Login and password Proxy server login and password information © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
26
Remote Data Access Using RDA Pull
6/12/2018 5:09 AM Remote Data Access Using RDA Pull Public Sub RDAPull() Dim rda as New SqlCeRemoteDataAccess Dim ServerOledbStr as String = “Provider=sqloledb; Data Source=DataServer;” _ “Initial Catalog=Pubs; User Id=sa; Password=;” rda.InternetUrl = “ rda.LocalConnectionString = ”Provider=Data Source=\My Documents\test.sdf” _ ”Password=bla; Encrypt Database=True” rda.Pull( “Authors”, _ “Select * from authors where state = ‘CA’”, _ ServerOledbStr, _ RdaTrackOption.TrackingOn) End Sub © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
27
Remote Data Access Using RDA Push
6/12/2018 5:09 AM Remote Data Access Using RDA Push Public Sub RDAPush() Dim rda as New SqlCeRemoteDataAccess Dim ServerOledbStr as String = “Provider=sqloledb; Data Source=dataserver;” _ “Initial Catalog=Pubs;User Id=sa;Password=;” rda.InternetUrl = “ rda.LocalConnectionString = ”Provider=Data Source=\My Documents\test.sdf” _ ”Password=bla; Encrypt Database=True” rda.Push( “Authors”, ServerOledbStr, RdaBatchOption.BatchingOn) End Sub © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
28
Merge Replication Overview
6/12/2018 5:09 AM Merge Replication Overview Originally designed for SQL to SQL synchronization Provides data synchronization between SQL Server Mobile and SQL Server SQL Server is the publisher SQL Server Mobile is the subscriber SQL Server Mobile receives initial snapshot from SQL Server Both SQL Server Mobile and SQL Server can modify the data Changes reconciled on next synchronization Microsoft .NET Compact Framework Managed wrapper SqlCeReplication © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
29
Merge Replication Architecture
6/12/2018 5:09 AM Merge Replication Architecture SQL Replication Provider Application SQL Mobile Client Agent SQL Mobile Server Agent SQL Reconciler SQL Mobile Common Tracking SQL Mobile Replication Provider .IN .OUT IIS Box © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
30
Merge Replication Examining the code
Public Sub SyncNewSubscription() Dim repl as New SqlCeReplication() repl.InternetUrl = " repl.Publisher = “SERVER1" repl.PublisherDatabase = “MyDatabase" repl.PublisherLogin = "salesApplicationLogin" repl.PublisherPassword = ”secretPassword" repl.Publication = “Merge_CustomerInfo" repl.Subscriber = “User1" repl.SubscriberConnectionString = _ ”Data Source=\My Documents\MyLocalDB.sdf“ repl.AddSubscription(AddOption.CreateDatabase) repl.Synchronize() End Sub © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
31
SQL Confusion Everywhere
6/12/2018 5:09 AM SQL Confusion Everywhere SQL Database for Desktop & Server MSDE/SQL Express (SQL/x) SQL 2000/2005 Operate as a Windows Service SQL for Devices (and Desktops) SQL CE – purely on devices SQL Mobile (SQL/m) – on devices and Windows XP/t SQL Everywhere (SQL/e) – same as SQL Mobile without licensing issues SQL/m & SQL/e – operate as an inprocess database © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
32
Data Access Block, Subscription Manager, DataMapper & SqlCeResultSet
Nick Randolph Solution Architect Microsoft Device MVP SoftTeq Pty Ltd © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
33
Features SummaryData Sync Summary
6/12/2018 5:09 AM Features SummaryData Sync Summary SqlClient SQL/m CSV XML Efficient data storage Works stand-alone Performance under load Direct data access for best performance Efficient updates Encrypted data optional © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
34
Summary Remember Data is king! Two primary data strategies:
6/12/2018 5:09 AM Summary Remember Data is king! Two primary data strategies: Roll your own solution If you absolutely need to do it Have the time to develop and test it… did I mention support? Use SQL CE/Mobile/Everywhere Lever Microsoft’s product group’s efforts PAG – Compact Framework Reusable Blocks Watch the PAG group for other cool CF features © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
35
Australian .Net Mailing List
The only Australian .Net developer focused online community – over 1200 developers! To Subscribe to the list, send to: In body of message type: subscribe dotnet YourName To Unsubscribe from list, send to: In body of message type: unsubscribe dotnet Send your messages to list via: Incoming s have a Subject line prefix: [aus-dotnet] Use Client rules to file into folders or use exchange rules
36
6/12/2018 5:09 AM Questions? © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
37
Resources SQL Server CE SQL Server 2005 Mobile Edition
6/12/2018 5:09 AM Resources youcantakeitwithyou_sqlserverce.asp?frame=true Newsgroup: news.microsoft.commicrosoft.public.sqlserver.ce SQL Server CE sql2k5mobile.asp sql2k5mobilesynch.asp SQL Mobile MSDN Forum: ForumID=152&SiteID=1 SQL Server 2005 Mobile Edition © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
38
More POOM Details Here POOM interop and Access COM interop and CFv2
6/12/2018 5:09 AM More POOM Details Here POOM interop and Access COM interop and CFv2 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
39
6/12/2018 5:09 AM © 2004 Microsoft Corporation. All rights reserved.
© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.