SlideShare uma empresa Scribd logo
1 de 30
Mobile Data with the  Compact Framework Shawn Wildermuth Senior Consultant/Architect Magenic Technologies
Who I Am ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How Mobile Data is Different ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Deciding on a Solution ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Limitations of the CF ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Limitations of the CF (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Limitations of the CF (3) ,[object Object],[object Object],[object Object]
SQL Client Data Access ,[object Object],[object Object],[object Object],// Create the connection and command SqlConnection conn = new SqlConnection("..."); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "SELECT * FROM Customers"; // Create a DataSet to put our results in DataSet ds = new DataSet(); // Create the adapter SqlDataAdapter da = new SqlDataAdapter(cmd); // Fill it da.Fill(ds, "Customers");
SQL Client Data Access (2) ,[object Object],[object Object],[object Object],// Create the connection and command SqlConnection conn = new SqlConnection("..."); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "SELECT * FROM Customers"; // Use a Reader try { conn.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { string name = rdr["CompanyName"].ToString(); } } finally { conn.Close(); }
SQL Server CE CLIENT SERVER QP/Cursor Engine/ES  Storage Engine / Repl Tracking SQL CE Edition v2.0 OLEDB OLEDB OLEDB CE CLR / .NET CF SQL Server CE Data Provider ADO.NET VS .NET (VB.NET, C#) . NET CF / Managed   Stack IIS Server Agent: Replication and Remote Data Access HTTP 802.11b, CDPD, GSM, CDMA, TDMA, etc. Occasionally Connected Data Provider Client Agent: Replication and RDA
SQL Server CE (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Setting up SQL Server CE - RDA ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],SqlCeRemoteDataAccess rda =  new SqlCeRemoteDataAccess("http://shawnw-lptd/sqlce/sscesa20.dll", "Data Source=northwind.sdf");
SQL Server CE - RDA ,[object Object],[object Object],[object Object],[object Object],[object Object],string rdaOleDbConnectString  =  "Provider=sqloledb;Data Source=shawnw-lptd;" + "Initial Catalog=Northwind;User Id=Sample;Password=ADONET"; rda.Pull("Customers", "SELECT * FROM Customers", rdaOleDbConnectString , RdaTrackOption.TrackingOnWithIndexes); rda.Pull("Products", "SELECT * FROM Products",  rdaOleDbConnectString , RdaTrackOption.TrackingOnWithIndexes); rda.Pull("Orders", "SELECT * FROM Orders",  rdaOleDbConnectString , RdaTrackOption.TrackingOnWithIndexes); rda.Pull("OrderDetails", "SELECT * FROM OrderDetails", rdaOleDbConnectString , RdaTrackOption.TrackingOnWithIndexes);
SQL Server CE – RDA (2) ,[object Object],[object Object],[object Object],// Create the connection and command Sql Ce Connection conn = new Sql Ce Connection("..."); Sql Ce Command cmd = conn.CreateCommand(); cmd.CommandText = "SELECT * FROM Customers"; // Create a DataSet to put our results in DataSet ds = new DataSet(); // Create the adapter Sql Ce DataAdapter da = new Sql Ce DataAdapter(cmd); // Fill it da.Fill(ds, "Customers");
SQL Server CE – RDA (3) ,[object Object],[object Object],[object Object],[object Object],rda.Push("Customers",  rdaOleDbConnectString, RdaBatchOption.BatchingOn); rda.Push("Products",  rdaOleDbConnectString, RdaBatchOption.BatchingOn); rda.Push("Orders",  rdaOleDbConnectString, RdaBatchOption.BatchingOn); rda.Push("OrderDetails",  rdaOleDbConnectString, RdaBatchOption.BatchingOn);
SQL Server CE – Merge Replication ,[object Object],[object Object],[object Object],[object Object],SqlCeReplication repl = new SqlCeReplication(); repl.InternetUrl  = "http://shawnw-lptd/sqlce/sscesa20.dll"; repl.Publisher  = "SHAWNW-LPTD"; repl.PublisherDatabase = "Northwind"; repl.PublisherLogin  = "sample"; repl.PublisherPassword = "ADONET"; repl.Publication  = "Northwind"; repl.Subscriber  = "OrderTaker";  repl.SubscriberConnectionString = "Data Source=northwind.sdf"; // Create the Local SSCE Database subscription repl.AddSubscription(AddOption.CreateDatabase); // Synchronize to the SQL Server 2000 to populate the Subscription  repl.Synchronize();
SQL Server CE – Merge Replication (2) ,[object Object],[object Object],[object Object],// Create the connection and command SqlCeConnection conn = new SqlCeConnection("..."); SqlCeCommand cmd = conn.CreateCommand(); cmd.CommandText = "SELECT * FROM Customers"; // Create a DataSet to put our results in DataSet ds = new DataSet(); // Create the adapter SqlCeDataAdapter da = new SqlCeDataAdapter(cmd); // Fill it da.Fill(ds, "Customers");
SQL Server CE – Merge Replication (3) ,[object Object],[object Object],[object Object],SqlCeReplication repl = new SqlCeReplication(); // ... // Synchronize to the SQL Server 2000  // to populate the Subscription  repl.Synchronize();
SQL Server CE - Caveats ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Web Services ,[object Object],[object Object],[object Object],[object Object],[object Object],[WebMethod] public XmlDocument Products() { // ... // Using WriteSchema to make sure the entire // structure is included on client side MemoryStream strm = new MemoryStream(); ds.WriteXml(strm,  XmlWriteMode.WriteSchema ); strm.Position = 0; XmlDocument doc = new XmlDocument(); doc.Load(strm); return doc; }
Web Services (2) ,[object Object],[object Object],[object Object],// Create the service GetPhoneDataService theSvc = new GetPhoneDataService(); // Load the data through the Web Service XmlDocument doc = theSvc.Products(); // NOTE: Can't use a Typed DataSet Here // Make it into a DataSet DataSet ds = new DataSet(); XmlNodeReader rdr = new XmlNodeReader(node); ds.ReadXml(rdr, XmlReadMode.ReadSchema); // Must use AcceptChanges  // (ReadXml makes rows new) ds.AcceptChanges();
Web Services (3) ,[object Object],[object Object],[object Object],[object Object],// Write the data locally ds.WriteXml("local.xml", XmlWriteMode.DiffGram); // Read it locally ds.ReadXml("local.xml", XmlReadMode.DiffGram);
Web Services (4) ,[object Object],[object Object],[object Object],[object Object],XmlDocument doc = new XmlDocument(); MemoryStream strm = new MemoryStream(); XmlTextWriter writer =  new XmlTextWriter(strm, System.Text.Encoding.UTF8); ds.WriteXml(writer,  XmlWriteMode.DiffGram ); strm.Position = 0; doc.Load(strm); svc.SetDataSet(doc); [WebMethod] public XmlDocument SaveChanges(XmlDocument doc) { MyTypedDs ds = new MyTypedDs(); ds.ReadXml(doc,  XmlReadMode.DiffGram ); DataSet updated = UpdateDataSet(ds); return new XmlDataDocument(updated); }
DataBinding ,[object Object],[object Object],[object Object],[object Object],// This is faster foreach (DataRow cust in ds.Tables["Customers"].Rows) { listBox1.Items.Add(cust["CompanyName"]); } // This is slower, but more functional listBox1.DataSource = ds.Tables["Customers"]; listBox1.DisplayMember = "CompanyName"; listBox1.ValueMember = "CustomerID";
DataBinding (2) ,[object Object],[object Object],[object Object],[object Object],CurrencyManager mgr =  (CurrencyManager)listBox1.BindingContext[ds.Tables["Customers"]]; mgr.Position++; DataTable tbl = ds.Tables["Customers"]; listBox.DataSource = tbl; comboBox.DataSource = tbl; textBox.Bindings.Add("Text", tbl, "CompanyName");
DataBinding (3) ,[object Object],// Launch the process on a background thread ThreadPool.QueueUserWorkItem(new WaitCallback(BindDataToForm)); void BindDataToForm(object o) { // Do Data Binding }
SQL Server Mobile Edition ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SQL Server Mobile Edition (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Questions?

Mais conteúdo relacionado

Mais procurados

21servers And Applets
21servers And Applets21servers And Applets
21servers And Applets
Adil Jafri
 
Ch06 ado.net fundamentals
Ch06 ado.net fundamentalsCh06 ado.net fundamentals
Ch06 ado.net fundamentals
Madhuri Kavade
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
Carol McDonald
 

Mais procurados (20)

Simple Data Binding
Simple Data BindingSimple Data Binding
Simple Data Binding
 
21servers And Applets
21servers And Applets21servers And Applets
21servers And Applets
 
Ado.Net
Ado.NetAdo.Net
Ado.Net
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
Ajax ppt
Ajax pptAjax ppt
Ajax ppt
 
Asp db
Asp dbAsp db
Asp db
 
Easing offline web application development with GWT
Easing offline web application development with GWTEasing offline web application development with GWT
Easing offline web application development with GWT
 
Ajax
AjaxAjax
Ajax
 
State management
State managementState management
State management
 
Ajax
AjaxAjax
Ajax
 
Mashup
MashupMashup
Mashup
 
Going Offline with Gears And GWT
Going Offline with Gears And GWTGoing Offline with Gears And GWT
Going Offline with Gears And GWT
 
JSON and XML
JSON and XMLJSON and XML
JSON and XML
 
Ado.net
Ado.netAdo.net
Ado.net
 
Ajax Ppt
Ajax PptAjax Ppt
Ajax Ppt
 
Ado .net
Ado .netAdo .net
Ado .net
 
For Beginers - ADO.Net
For Beginers - ADO.NetFor Beginers - ADO.Net
For Beginers - ADO.Net
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
 
Ch06 ado.net fundamentals
Ch06 ado.net fundamentalsCh06 ado.net fundamentals
Ch06 ado.net fundamentals
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
 

Destaque

The basic concept of internet connection
The basic concept of internet connectionThe basic concept of internet connection
The basic concept of internet connection
JGrace Johnny
 
Mobile devices ppt
Mobile devices pptMobile devices ppt
Mobile devices ppt
im_mi
 
The advantages and disadvantages of online learning
The advantages and disadvantages of online learningThe advantages and disadvantages of online learning
The advantages and disadvantages of online learning
Janna8482
 

Destaque (7)

Impact of mobile access on learner interactions in a mooc method and findings
Impact of mobile access on learner interactions in a mooc method and findingsImpact of mobile access on learner interactions in a mooc method and findings
Impact of mobile access on learner interactions in a mooc method and findings
 
The Power of Connecting People
The Power of Connecting PeopleThe Power of Connecting People
The Power of Connecting People
 
Basic concepts of information technology and the internet
Basic concepts of information technology and the internetBasic concepts of information technology and the internet
Basic concepts of information technology and the internet
 
The basic concept of internet connection
The basic concept of internet connectionThe basic concept of internet connection
The basic concept of internet connection
 
Philippines mobile internet trends
Philippines mobile internet trendsPhilippines mobile internet trends
Philippines mobile internet trends
 
Mobile devices ppt
Mobile devices pptMobile devices ppt
Mobile devices ppt
 
The advantages and disadvantages of online learning
The advantages and disadvantages of online learningThe advantages and disadvantages of online learning
The advantages and disadvantages of online learning
 

Semelhante a Data Access Mobile Devices

Networking and Data Access with Eqela
Networking and Data Access with EqelaNetworking and Data Access with Eqela
Networking and Data Access with Eqela
jobandesther
 
SQLite in Adobe AIR
SQLite in Adobe AIRSQLite in Adobe AIR
SQLite in Adobe AIR
Peter Elst
 
30 5 Database Jdbc
30 5 Database Jdbc30 5 Database Jdbc
30 5 Database Jdbc
phanleson
 
10 performance and scalability secrets of ASP.NET websites
10 performance and scalability secrets of ASP.NET websites10 performance and scalability secrets of ASP.NET websites
10 performance and scalability secrets of ASP.NET websites
oazabir
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
Aren Zomorodian
 

Semelhante a Data Access Mobile Devices (20)

Chapter 3: ado.net
Chapter 3: ado.netChapter 3: ado.net
Chapter 3: ado.net
 
B_110500002
B_110500002B_110500002
B_110500002
 
Practical OData
Practical ODataPractical OData
Practical OData
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
 
PPT
PPTPPT
PPT
 
Php frameworks
Php frameworksPhp frameworks
Php frameworks
 
70562-Dumps
70562-Dumps70562-Dumps
70562-Dumps
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Networking and Data Access with Eqela
Networking and Data Access with EqelaNetworking and Data Access with Eqela
Networking and Data Access with Eqela
 
ASP.NET-stored procedure-manual
ASP.NET-stored procedure-manualASP.NET-stored procedure-manual
ASP.NET-stored procedure-manual
 
SQLite in Adobe AIR
SQLite in Adobe AIRSQLite in Adobe AIR
SQLite in Adobe AIR
 
30 5 Database Jdbc
30 5 Database Jdbc30 5 Database Jdbc
30 5 Database Jdbc
 
WCF - In a Week
WCF - In a WeekWCF - In a Week
WCF - In a Week
 
58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services
 
10 performance and scalability secrets of ASP.NET websites
10 performance and scalability secrets of ASP.NET websites10 performance and scalability secrets of ASP.NET websites
10 performance and scalability secrets of ASP.NET websites
 
my accadanic project ppt
my accadanic project pptmy accadanic project ppt
my accadanic project ppt
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
 
Data Access with JDBC
Data Access with JDBCData Access with JDBC
Data Access with JDBC
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Data Access Mobile Devices

  • 1. Mobile Data with the Compact Framework Shawn Wildermuth Senior Consultant/Architect Magenic Technologies
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. SQL Server CE CLIENT SERVER QP/Cursor Engine/ES Storage Engine / Repl Tracking SQL CE Edition v2.0 OLEDB OLEDB OLEDB CE CLR / .NET CF SQL Server CE Data Provider ADO.NET VS .NET (VB.NET, C#) . NET CF / Managed Stack IIS Server Agent: Replication and Remote Data Access HTTP 802.11b, CDPD, GSM, CDMA, TDMA, etc. Occasionally Connected Data Provider Client Agent: Replication and RDA
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.