Data Access with SQL Server 2005 Mobile Edition and the.NET Compact Framework v2.0 Scott Colestock.

Slides:



Advertisements
Similar presentations
DEV-2: Getting Started with OpenEdge® Architect – Part I
Advertisements

Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Module 3: Microsoft Mobility Solutions. Overview Microsoft Office Mobile Using Windows Mobile 5.0 with Exchange Server 2003 Using Windows Mobile 5.0 with.
SQL Server Replication
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
SQL Server 2005 Database Engine Sommarkollo Microsoft.
.NET Mobile Application Development Data in Distributed Systems Accessing Data with.NET.
Design & Development Tools: Visual Studio 2005 SQL Server 2005 Biztalk Server 2006 David Gristwood, Mike Taulty Developer & Platform Group Microsoft Ltd.
What’s new for Rich Clients? Martin Parry Developer & Platform Group Microsoft Ltd
Managing and Monitoring SQL Server 2005 Shankar Pal Program Manager SQL Server, Redmond.
Passage Three Introduction to Microsoft SQL Server 2000.
Query Processing in Mobile Databases
Mobile Data with the Compact Framework Shawn Wildermuth Senior Consultant/Architect Magenic Technologies Shawn Wildermuth Senior Consultant/Architect Magenic.
Discover, Master, InfluenceSlide 1 SQL Server Compact Edition and the Entity Framework Rob Sanders Readify.
Virtual techdays INDIA │ august 2010 Building ASP.NET applications using SQL Server Compact Chaitanya Solapurkar │ Partner Technical Consultant,
Module 9: SQL Server 2005 Replication. Overview Overview of Replication Enhancements New Types of Replication Configuring Replication.
DAT304 Leveraging XML and HTTP with Sql Server Irwin Dolobowsky Program Manager Webdata Group.
Windows Mobile 5.0 Features & Functionality! Wim Verhaeghen - Erwin van Hunen -
SQL Server Replication By Karthick P.K Technical Lead, Microsoft SQL Server.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
SSIS Over DTS Sagayaraj Putti (139460). 5 September What is DTS?  Data Transformation Services (DTS)  DTS is a set of objects and utilities that.
Overview of SQL Server Alka Arora.
9 Chapter Nine Extracting and Transforming Data with SQL Server 2000.
Distributing Data for Availability and Scalability Don Vilen Program Manager SQL Server Microsoft Corporation.
Native Support for Web Services  Native Web services access  Enables cross platform interoperability  Reduces middle-tier dependency (no IIS)  Simplifies.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
DAT201: Introduction To SQL Server ™ Replication Matt Hollingsworth Program Manager Microsoft Corporation.
Introducing Reporting Services for SQL Server 2005.
Business Solutions Using Microsoft ® Office SharePoint ® Server ROADSHOW.
Developing Reporting Solutions with SQL Server
Overview of Data Access MacDonald Ch. 15 MIS 324 Professor Sandvig.
Tom Castiglia Hershey Technologies
DBSQL 14-1 Copyright © Genetic Computer School 2009 Chapter 14 Microsoft SQL Server.
Overview – Chapter 11 SQL 710 Overview of Replication
Module 6: Implementing SQL Server Replication in an Enterprise Environment.
1 Chapter Overview Introducing Replication Planning for Replication Implementing Replication Monitoring and Administering Replication.
Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Windows Forms in Visual Studio 2005 Mike Pelton Systems Engineer Microsoft Ltd
Name Microsoft Student Partner Overview of the Visual Studio 2005 Express Products.
Enabling Enterprise Applications Marcus Perryman Microsoft
 Replication is the process of copying database information  Replication is used for:  Backing up your database  Migrating to a new server  Mirroring.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
SQL Server 2005 Implementation and Maintenance Chapter 12: Achieving High Availability Through Replication.
Web Services Error Handling and Debugging. Agenda Simple SOAP faults Advanced SOAP faults SOAP headers and faults Error handling From a Service Perspective.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
SQL Mobile 2005: Overview Gaurav Khanna, Developer Evangelist Developer & Platform Evangelism Microsoft Corporation (India)
Mobile Applications and SQL Server Mobile v3.0 (Laguna) Kevin Collins Senior Program Manager Microsoft Corporation.
Module 5: Implementing Merge Replication. Overview Understanding Merge Replication Architecture Implementing Conflict Resolution Planning and Deploying.
Module 3: Working with Local Data. Overview Using DataSets Using XML Using SQL Server CE.
Developing SQL Server 2000 Reporting Services Applications Brian Welcker Group Program Manager SQL Server Reporting Services Microsoft Corporation.
Enhancing Scalability and Availability of the Microsoft Application Platform Damir Bersinic Ruth Morton IT Pro Advisor Microsoft Canada
Features Of SQL Server 2000: 1. Internet Integration: SQL Server 2000 works with other products to form a stable and secure data store for internet and.
SVR201 SQL Server 2005 Mobile Edition: The Evolution Of SQL Server CE Scott Smith Program Manager Visual Studio for Devices Microsoft Corporation.
Device Development with Visual Studio 2005 and Future Windows Mobile Platform Per Ahlberg Developer Evangelist Microsoft AB.
Introduction to SQL Server 2000 Reporting Services Jeff Dumas Technical Specialist Microsoft Corporation
Excel Services Displays all or parts of interactive Excel worksheets in the browser –Excel “publish” feature with optional parameters defined in worksheet.
Exploring Networked Data and Data Stores Lesson 3.
Developing Custom ASP.NET Providers For Membership And Role Manager Stefan Schackow PRS404 Program Manager – Web Platform and Tools Microsoft Corporation.
Building Enterprise Applications Using Visual Studio®
6/12/2018 5:09 AM © 2004 Microsoft Corporation. All rights reserved.
Chris Menegay Sr. Consultant TECHSYS Business Solutions
What’s New in SQL Server 2016 Master Data Services
Introduction to Replication
Visual Studio Tools for Office 2005
Visual Studio 2005 Tools For Office: Creating A Multi-tier Application
Visual Studio + SQL Server Is Better
ADO.NET Entity Framework
Getting Data Where and When You Want it with SQL Server 2005
Presentation transcript:

Data Access with SQL Server 2005 Mobile Edition and the.NET Compact Framework v2.0 Scott Colestock

Agenda Overview – SQL Mobile Architecture SQL Server 2005 Integration Visual Studio 2005 Integration Merge Replication

Overview Device Data Access Native Stack Managed Stack SQL Server Mobile Edition CLR /.NET CF SQL Server CE Data Provider ADO.NET VB.NET / C# VS 2005 C++ OLEDB CE OLEDB Provider QP / Cursor Engine / ES Storage Engine / Replication Tracking

Overview Highly Integrated into Development Tools Integration with SQL Server 2005 DTS Support Show Plan and Hints SQL Server Management Studio Integration with Visual Studio 2005 Ships with Visual Studio 2005 Database management functionality Easy code upgrades from SQL Server CE 2.0

Overview Architecture Improvements Storage engine Multiconnection support Row level locking of data Shares common memory pool Auto-shrink support Improved query processor Cost-based optimization Show plan and query hints Scrollable, updatable cursor – SqlCeResultSet

Overview Synchronization Improvements Improved synchronization control Multiuser synchronization Progress notifications Multiple subscriptions in the same database Synchronization performance (w/SQL 2005) Partitioned articles Download-only tables Column-level tracking

Overview Introducing the SqlCeResultSet Development Features Included in SQL Mobile, ships with: Visual Studio 2005 SQL Server 2005 Takes full advantage of SQL Server 2005 Mobile Edition local capabilities Extended Features Scrolling access Update in place Random access

SQL Server 2005 Integration SQL Server 2005 Tools Business Intelligence Development Studio Visual Tools for creating Data Transformation Data Visualization Enhanced Debugging

SQL Server 2005 Integration SQL Server 2005 Tools SQL Server Management Studio Create SQL Mobile Databases Show Plan and Hints Faster Optimization Enhanced Publication Subscription Wizard

SQL Server 2005 Integration

Visual Studio 2005 Integration Visual Studio Tools Flexible Development Native and managed development environment Visual Basic. NET, Visual C++, Visual C# all localized in the IDE Targets multiple devices

Visual Studio 2005 Integration Visual Studio Tools Rapid Development Data designer support via Visual Studio 2005 IDE Drag and drop controls onto form and automatically bind

Visual Studio 2005 Integration Visual Studio Tools Library Evolution SqlCeEngine, SqlCeConnection, SqlCeCommand, SqlCeDataReader SqlCeResultSet (new updatable scrollable cursor)

Visual Studio 2005 Integration

Synchronization Goals of Synchronization Simplify development of synchronization logic Sync becomes a single line of code Conflict resolution happens on the server through SQL Server model Share a common (mobile) data source Allow multiuser access to the same data source (that lives on the device) Improve performance and data concurrency More end-user versatility Allows end users to change devices and still access the data source

OLE DB SQL Mobile Client Agent Synchronization Overall Architecture HTTP OLE DB Application SQL Mobile Engine MobileDatabase SQL Server Database OLE DB Provider SQL Mobile Server Agent Internet Information Services (IIS)

Synchronization Outlining Your Options SQL Server Mobile Edition provides two synchronization solutions Remote Data Access (RDA) Merge replication Both require server components that are on IIS.

Remote Data Access Overview Loosely coupled connectivity between SQL Server Mobile Edition and SQL Server No configuration of the back-end Sql Server required Client application specifies query to return data for a local table (table-at-a-time metaphor) Optionally tracks changes locally Sends locally changed records back to SQL Server The.NET Compact Framework provides managed wrapper SqlCeRemoteDataAccess

Remote Data Access Using SqlCeRemoteDataAccess An application must specify RDA connectivity parameters Web server information URL – must include sqlcesa30.dll Login and password Local database information (SQL Mobile Edition OLE DB connection string) Proxy server login and password information Remote DB info sent with each command (SQL Connection String)

Remote Data Access Pull Operation Local table created including data and schema Optionally includes primary key Optionally includes indexes Values may come from a table or stored procedure Can retrieve all data for complete data set or… Can filter data to reduce data size View/stored procedure can reference only one table with a primary key

Remote Data Access Pull Operation Optionally track local changes Changes can be later applied Uses optimistic concurrency (no server data locked) Local table must not exist before pull Created during pull operation Error thrown if table exists

Remote Data Access Using RDA Pull Public Sub RDAPull() Dim rda as New SqlCeRemoteDataAccess Dim rda as New SqlCeRemoteDataAccess Dim ServerOledbStr as String = Dim ServerOledbStr as String = “ Provider=sqloledb; Data Source=dataserver; ” _ “ Provider=sqloledb; Data Source=dataserver; ” _ “ Initial Catalog=Pubs;User Id=sa;Password=; ” “ Initial Catalog=Pubs;User Id=sa;Password=; ” rda.LocalConnectionString = rda.LocalConnectionString = ” Provider=Data Source=\My Documents\test.sdf ” ” Provider=Data Source=\My Documents\test.sdf ” ‘ Set URL and IIS login/password. rda.InternetUrl = “ works.com/sqlmobile/sqlcesa30.dll” rda.Pull( rda.Pull( “ Authors ”, _ “ Authors ”, _ “ Select * from authors where state = ‘ CA ’”, _ “ Select * from authors where state = ‘ CA ’”, _ ServerOledbStr, _ ServerOledbStr, _ RdaTrackOption.TrackingOn) RdaTrackOption.TrackingOn) End Sub

Remote Data Access Push Operation Sends changes back to server All changes since last pull or push are applied Changes applied to server indiscriminately Table tracking must have been specified during pull operation Can choose if updates batched as one transaction, or distinct Can have conflicts logged in Errors table

Remote Data Access Using RDA Push Public Sub RDAPush() Dim rda = New SqlCeRemoteDataAccess() Dim rda = New SqlCeRemoteDataAccess() Dim ServerOledbStr as String = Dim ServerOledbStr as String = “ Provider=sqloledb; Data Source=dataserver; ” _ “ Provider=sqloledb; Data Source=dataserver; ” _ “ Initial Catalog=Pubs;User Id=sa;Password=; ” “ Initial Catalog=Pubs;User Id=sa;Password=; ” rda.LocalConnectionString = _ rda.LocalConnectionString = _ ” Data Source=\My Documents\test.sdf ” ‘ Set URL and IIS login/password. ‘ Set URL and IIS login/password. rda.InternetUrl = “ works.com/sqlmobile/sqlcesa30.dll ” rda.InternetUrl = “ works.com/sqlmobile/sqlcesa30.dll ”rda.Push( “ Authors ”, “ Authors ”, ServerOledbStr, ServerOledbStr, RdaBatchOption.BatchingOn) RdaBatchOption.BatchingOn) End Sub

Merge Replication Overview Provides data synchronization between SQL Server 2005 Mobile Edition and SQL Server SQL Server is the publisher SQL Server 2005 Mobile Edition is the subscriber SQL Server 2005 Mobile Edition receives initial snapshot from SQL Server Both SQL Server 2005 Mobile Edition and SQL Server can modify the data Conflict resolution can be customized

Merge Replication Overview Changes reconciled on next synchronization Local SQL Server 2005 Mobile Edition changes sent to SQL Server SQL Server changes sent to SQL Server 2005 Mobile Edition SQL Server Management Studio wizards Publishers created in studio Subscribers create in studio.NET Compact Framework managed wrapper - SqlCeReplication

Merge Replication Examining the Code Public Sub SyncSubscription() Dim repl as New SqlCeReplication() Dim repl as New SqlCeReplication() repl.InternetUrl = repl.InternetUrl = " " repl.Publisher = “ SERVER1" repl.Publisher = “ SERVER1" repl.PublisherDatabase = “ CustmerInfo" repl.PublisherDatabase = “ CustmerInfo" repl.PublisherLogin = "sa" repl.PublisherLogin = "sa" repl.PublisherPassword = "" repl.PublisherPassword = "" repl.Publication = "CustomerInfoPub" repl.Publication = "CustomerInfoPub" repl.SubscriberConnectionString = _ repl.SubscriberConnectionString = _ ” Data Source=\My Documents\MyLocalDB.sdf “ repl.Subscriber = “ CustomerInfoSub" repl.Subscriber = “ CustomerInfoSub" repl.AddSubscription(AddOption.CreateDatabase) repl.AddSubscription(AddOption.CreateDatabase) repl.Synchronize() repl.Synchronize() End Sub

Merge Replication Weighing the Costs Several triggers and stored procedures added Added to system tables Adds more overhead Replicated tables must have a ROWGUIDCOL Ensures that rows are unique Can avoid if rowguid column is added prior Database must track all modifications Additional tables added to system database Tables used to track modifications Can grow significantly

Merge Replication Minimizing the Costs for Device Applications Key to success for device apps is minimizing communication Take only what you need Apply filters Static or Parameterized JoinColumn Reducing the amount of data sent between devices and server… Reduces sync time Improves responsiveness

Exploring Merge Replication

Making The Replication Choice Recommendations Remote Data Access If you can’t modify the backend database… If you have small tables to bring to the device… If the tables you modify are distinct from those you reference… Choose merge replication Bi-directional synchronization on all tables – only the deltas are transferred Much more flexible conflict resolution For more on making the choice html/eff_arch_sql_servr_ce_rep.asp “Comparing Remote Data Access (RDA) and Merge Replication” in SQL 2005 BOL

Summary SQL Server 2005 Mobile Edition functionality is greatly enhanced for developers Integration with SQL Server 2005 makes generation and maintenance of SQL Mobile databases better Integration with Visual Studio 2005 makes developing of SQL Mobile applications easier and faster Remote data access vs. merge replication

Heartland Developers Conference ’05 October 13 – 14, Cedar Rapids, IA TWICE THE SIZE (days, sessions, attendees, parties) Developer Pre-Party on the 12 th and Developer Jam on the 13 th 2 Keynotes, 18 Sessions, Developer Lounges 2 Tracks: Center Stage / Behind the Curtain Many door prizes including a top of the line Alienware Laptop!

© 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY. Content created by 3 Leaf Solutions