SlideShare a Scribd company logo
1 of 18
When database matters!
Fiyaz Bin Hasan
Former MSP (AUST) , NerdCats
When to choose what?
Persist data in my WP 8.1 (Silverlight) app
Local database (SQLCE) saves the day
Store relational data
Sits in app’s local folder
Use LINQ TO SQL for
 CREATE
 RETRIEVE
 UPDATE
 DELETE
What about Windows Phone Apps under
WinRT framework?
Third party database support!
SQLite for Windows Phone 8.1
World’s most popular database
Used in other OS too
Fast & Reliable
Support for multiple tables, triggers, views, indices
Follow ACID rules
What you need to
know when using
database in WP 8.1
(Silverlight)
Your database is in your code
DataContext
Act as a proxy, object that represents the database.
Table objects, represents a table in the database.
Made up of entities
Entity is a “plain old CLR object” (POCO) with attributes.
Behind the scene!
BlogId BlogName
Value Value
Blogs Table
PostId PostName
Value Value
Posts Table
BlogPostDatacontext
Play with data in OOP manners
LINQ TO SQL
ORM capabilities
Use LINQ to speak with the database
Translate LINQ to Transact-SQL and query the
database
Took the results and translate it again to LINQ
How it really works!
DataContext and Local database relation
Data Context Local Database
LINQ TO SQL
RUNTIME
Define who goes where!
LINQ to SQL mapping attributes
Specify database-specific features such as tables,
columns, primary keys, and indexes.
DatabaseAttribute (Name)
TableAttribute (Name)
ColumnAttribute (AutoSync, IsForeignKey, DbType, IsVersion)
AssociationAttribute (IsForeignKey, DeleteRule)
DataAttribute (Storage)
Teach LINQ TO SQL what to do
PostId (Pk) PostContent
Value (NOT NULL)
(AUTOINCREMENT)
(INT)
Value
Post Table
Association (1 to many)
PostId (Pk) PostContent BlogId
Value (NOT NULL)
(AUTOINCREMENT)
(INT)
Value value
BlogId (Pk) BlogName
Value (NOT NULL)
(AUTOINCREMENT)
(INT)
Value
Foreign Key
Post table
Blog table 1
M
Association dissection!
Foreign Key
Navigational Property
(Blog Reference)
Post list reference
Its time for CRUD
CRUD with LINQ
SELECT/RETRIEVE
INSERT/CREATE
UPDATE
DELETE
After All
_blogPostDataContext.SubmitChanges();
DEMO
What you need to
know when using
database in WP 8.1
(WinRT)

More Related Content

What's hot

Learn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstLearn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstJibran Rasheed Khan
 
Real World Sql Azure
Real World Sql AzureReal World Sql Azure
Real World Sql AzureJames Johnson
 
SQLite forensics - Free Lists, unallocated space, carving
SQLite forensics - Free Lists, unallocated space, carvingSQLite forensics - Free Lists, unallocated space, carving
SQLite forensics - Free Lists, unallocated space, carvingDmitry Kirillin
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)David McCarter
 
Flexible Resources In 3 6 And E4
Flexible Resources In 3 6 And E4Flexible Resources In 3 6 And E4
Flexible Resources In 3 6 And E4szbra
 
Practical approaches to entification in library bibliographic data
Practical approaches to entification in library bibliographic dataPractical approaches to entification in library bibliographic data
Practical approaches to entification in library bibliographic dataTerry Reese
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use itnspyre_net
 
Web Programming - 8 Database, Model and Eloquent
Web Programming - 8 Database, Model and EloquentWeb Programming - 8 Database, Model and Eloquent
Web Programming - 8 Database, Model and EloquentAndiNurkholis1
 
Web Programming - 9 Create, Read, Update and Delete
Web Programming - 9 Create, Read, Update and DeleteWeb Programming - 9 Create, Read, Update and Delete
Web Programming - 9 Create, Read, Update and DeleteAndiNurkholis1
 
RapidApp presentation for Cincinnati.pm
RapidApp presentation for Cincinnati.pmRapidApp presentation for Cincinnati.pm
RapidApp presentation for Cincinnati.pmHenry Van Styn
 
Entity Extraction from Natural Language Text using Apache NiFi and Idyl E3
Entity Extraction from Natural Language Text using Apache NiFi and Idyl E3Entity Extraction from Natural Language Text using Apache NiFi and Idyl E3
Entity Extraction from Natural Language Text using Apache NiFi and Idyl E3Mountain Fog
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity FrameworkHasnain Iqbal
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code FirstJames Johnson
 
Web Programming - 10 JavaScript
Web Programming - 10 JavaScriptWeb Programming - 10 JavaScript
Web Programming - 10 JavaScriptAndiNurkholis1
 
Fitting MarcEdit into the library software ecosystem
Fitting MarcEdit into the library software ecosystemFitting MarcEdit into the library software ecosystem
Fitting MarcEdit into the library software ecosystemTerry Reese
 
C# Framework class library
C# Framework class libraryC# Framework class library
C# Framework class libraryPrem Kumar Badri
 

What's hot (19)

Learn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstLearn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database First
 
Real World Sql Azure
Real World Sql AzureReal World Sql Azure
Real World Sql Azure
 
SQLite forensics - Free Lists, unallocated space, carving
SQLite forensics - Free Lists, unallocated space, carvingSQLite forensics - Free Lists, unallocated space, carving
SQLite forensics - Free Lists, unallocated space, carving
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
Tech WG report 2011
Tech WG report 2011Tech WG report 2011
Tech WG report 2011
 
Flexible Resources In 3 6 And E4
Flexible Resources In 3 6 And E4Flexible Resources In 3 6 And E4
Flexible Resources In 3 6 And E4
 
Practical approaches to entification in library bibliographic data
Practical approaches to entification in library bibliographic dataPractical approaches to entification in library bibliographic data
Practical approaches to entification in library bibliographic data
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use it
 
Mdst 3559-04-21-data-2
Mdst 3559-04-21-data-2Mdst 3559-04-21-data-2
Mdst 3559-04-21-data-2
 
Sq lite
Sq liteSq lite
Sq lite
 
Web Programming - 8 Database, Model and Eloquent
Web Programming - 8 Database, Model and EloquentWeb Programming - 8 Database, Model and Eloquent
Web Programming - 8 Database, Model and Eloquent
 
Web Programming - 9 Create, Read, Update and Delete
Web Programming - 9 Create, Read, Update and DeleteWeb Programming - 9 Create, Read, Update and Delete
Web Programming - 9 Create, Read, Update and Delete
 
RapidApp presentation for Cincinnati.pm
RapidApp presentation for Cincinnati.pmRapidApp presentation for Cincinnati.pm
RapidApp presentation for Cincinnati.pm
 
Entity Extraction from Natural Language Text using Apache NiFi and Idyl E3
Entity Extraction from Natural Language Text using Apache NiFi and Idyl E3Entity Extraction from Natural Language Text using Apache NiFi and Idyl E3
Entity Extraction from Natural Language Text using Apache NiFi and Idyl E3
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Framework
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code First
 
Web Programming - 10 JavaScript
Web Programming - 10 JavaScriptWeb Programming - 10 JavaScript
Web Programming - 10 JavaScript
 
Fitting MarcEdit into the library software ecosystem
Fitting MarcEdit into the library software ecosystemFitting MarcEdit into the library software ecosystem
Fitting MarcEdit into the library software ecosystem
 
C# Framework class library
C# Framework class libraryC# Framework class library
C# Framework class library
 

Similar to Play With Windows Phone Local Database

Top 7 React Native Databases For App Development
Top 7 React Native Databases For App DevelopmentTop 7 React Native Databases For App Development
Top 7 React Native Databases For App Developmentsimonedaniels3
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overviewukdpe
 
Using SQL Local Database in Mobile Applications
Using SQL Local Database in Mobile ApplicationsUsing SQL Local Database in Mobile Applications
Using SQL Local Database in Mobile ApplicationsMihail Mateev
 
Apache Phoenix with Actor Model (Akka.io) for real-time Big Data Programming...
Apache Phoenix with Actor Model (Akka.io)  for real-time Big Data Programming...Apache Phoenix with Actor Model (Akka.io)  for real-time Big Data Programming...
Apache Phoenix with Actor Model (Akka.io) for real-time Big Data Programming...Trieu Nguyen
 
12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptxFaezNasir
 
Database application developer's guide
Database application developer's guideDatabase application developer's guide
Database application developer's guideSudar's Juba
 
Data Analytics Meetup: Introduction to Azure Data Lake Storage
Data Analytics Meetup: Introduction to Azure Data Lake Storage Data Analytics Meetup: Introduction to Azure Data Lake Storage
Data Analytics Meetup: Introduction to Azure Data Lake Storage CCG
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity FrameworkDoncho Minkov
 
Samedi SQL Québec - La plateforme data de Azure
Samedi SQL Québec - La plateforme data de AzureSamedi SQL Québec - La plateforme data de Azure
Samedi SQL Québec - La plateforme data de AzureMSDEVMTL
 
Firebird database that does not burn your data
Firebird   database that does not burn your dataFirebird   database that does not burn your data
Firebird database that does not burn your dataIdo Kanner
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework OverviewEric Nelson
 
[2C6]SQLite DB 의 입출력 특성분석 : Android 와 Tizen 사례
[2C6]SQLite DB 의 입출력 특성분석 : Android 와 Tizen 사례[2C6]SQLite DB 의 입출력 특성분석 : Android 와 Tizen 사례
[2C6]SQLite DB 의 입출력 특성분석 : Android 와 Tizen 사례NAVER D2
 

Similar to Play With Windows Phone Local Database (20)

Top 7 React Native Databases For App Development
Top 7 React Native Databases For App DevelopmentTop 7 React Native Databases For App Development
Top 7 React Native Databases For App Development
 
Oracle database introduction
Oracle database introductionOracle database introduction
Oracle database introduction
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
 
Using SQL Local Database in Mobile Applications
Using SQL Local Database in Mobile ApplicationsUsing SQL Local Database in Mobile Applications
Using SQL Local Database in Mobile Applications
 
Oracle's history
Oracle's historyOracle's history
Oracle's history
 
Flask SQLite .pdf
Flask SQLite .pdfFlask SQLite .pdf
Flask SQLite .pdf
 
27 fcs157al1 (1)
27 fcs157al1 (1)27 fcs157al1 (1)
27 fcs157al1 (1)
 
Mdst 3559-02-22-sql1
Mdst 3559-02-22-sql1Mdst 3559-02-22-sql1
Mdst 3559-02-22-sql1
 
Apache Phoenix with Actor Model (Akka.io) for real-time Big Data Programming...
Apache Phoenix with Actor Model (Akka.io)  for real-time Big Data Programming...Apache Phoenix with Actor Model (Akka.io)  for real-time Big Data Programming...
Apache Phoenix with Actor Model (Akka.io) for real-time Big Data Programming...
 
12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx
 
Database application developer's guide
Database application developer's guideDatabase application developer's guide
Database application developer's guide
 
Hibernate 3
Hibernate 3Hibernate 3
Hibernate 3
 
Data Analytics Meetup: Introduction to Azure Data Lake Storage
Data Analytics Meetup: Introduction to Azure Data Lake Storage Data Analytics Meetup: Introduction to Azure Data Lake Storage
Data Analytics Meetup: Introduction to Azure Data Lake Storage
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Framework
 
Samedi SQL Québec - La plateforme data de Azure
Samedi SQL Québec - La plateforme data de AzureSamedi SQL Québec - La plateforme data de Azure
Samedi SQL Québec - La plateforme data de Azure
 
Firebird database that does not burn your data
Firebird   database that does not burn your dataFirebird   database that does not burn your data
Firebird database that does not burn your data
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
 
Entity Framework
Entity FrameworkEntity Framework
Entity Framework
 
Sqlite Multiple Table
Sqlite Multiple TableSqlite Multiple Table
Sqlite Multiple Table
 
[2C6]SQLite DB 의 입출력 특성분석 : Android 와 Tizen 사례
[2C6]SQLite DB 의 입출력 특성분석 : Android 와 Tizen 사례[2C6]SQLite DB 의 입출력 특성분석 : Android 와 Tizen 사례
[2C6]SQLite DB 의 입출력 특성분석 : Android 와 Tizen 사례
 

More from Fiyaz Hasan

Hands free with cortana
Hands free with cortanaHands free with cortana
Hands free with cortanaFiyaz Hasan
 
Up & Running with Polymer
Up & Running with PolymerUp & Running with Polymer
Up & Running with PolymerFiyaz Hasan
 
Preventing XSRF in ASP.NET CORE apps
Preventing XSRF in ASP.NET CORE appsPreventing XSRF in ASP.NET CORE apps
Preventing XSRF in ASP.NET CORE appsFiyaz Hasan
 
Azure push notification hub
Azure push notification hubAzure push notification hub
Azure push notification hubFiyaz Hasan
 
What’s new in C# 6
What’s new in C# 6What’s new in C# 6
What’s new in C# 6Fiyaz Hasan
 
Tales of Two Brothers
Tales of Two BrothersTales of Two Brothers
Tales of Two BrothersFiyaz Hasan
 
When You Cant Code You Can Blend
When You Cant Code You Can BlendWhen You Cant Code You Can Blend
When You Cant Code You Can BlendFiyaz Hasan
 
Walk in the shoe of angular
Walk in the shoe of angularWalk in the shoe of angular
Walk in the shoe of angularFiyaz Hasan
 

More from Fiyaz Hasan (8)

Hands free with cortana
Hands free with cortanaHands free with cortana
Hands free with cortana
 
Up & Running with Polymer
Up & Running with PolymerUp & Running with Polymer
Up & Running with Polymer
 
Preventing XSRF in ASP.NET CORE apps
Preventing XSRF in ASP.NET CORE appsPreventing XSRF in ASP.NET CORE apps
Preventing XSRF in ASP.NET CORE apps
 
Azure push notification hub
Azure push notification hubAzure push notification hub
Azure push notification hub
 
What’s new in C# 6
What’s new in C# 6What’s new in C# 6
What’s new in C# 6
 
Tales of Two Brothers
Tales of Two BrothersTales of Two Brothers
Tales of Two Brothers
 
When You Cant Code You Can Blend
When You Cant Code You Can BlendWhen You Cant Code You Can Blend
When You Cant Code You Can Blend
 
Walk in the shoe of angular
Walk in the shoe of angularWalk in the shoe of angular
Walk in the shoe of angular
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
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 DiscoveryTrustArc
 
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 WoodJuan lago vázquez
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
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...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
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.pdfOrbitshub
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
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 FMESafe Software
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 

Recently uploaded (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
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
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 

Play With Windows Phone Local Database

  • 1. When database matters! Fiyaz Bin Hasan Former MSP (AUST) , NerdCats
  • 3. Persist data in my WP 8.1 (Silverlight) app Local database (SQLCE) saves the day Store relational data Sits in app’s local folder Use LINQ TO SQL for  CREATE  RETRIEVE  UPDATE  DELETE
  • 4. What about Windows Phone Apps under WinRT framework?
  • 5. Third party database support! SQLite for Windows Phone 8.1 World’s most popular database Used in other OS too Fast & Reliable Support for multiple tables, triggers, views, indices Follow ACID rules
  • 6. What you need to know when using database in WP 8.1 (Silverlight)
  • 7. Your database is in your code DataContext Act as a proxy, object that represents the database. Table objects, represents a table in the database. Made up of entities Entity is a “plain old CLR object” (POCO) with attributes.
  • 8. Behind the scene! BlogId BlogName Value Value Blogs Table PostId PostName Value Value Posts Table BlogPostDatacontext
  • 9. Play with data in OOP manners LINQ TO SQL ORM capabilities Use LINQ to speak with the database Translate LINQ to Transact-SQL and query the database Took the results and translate it again to LINQ
  • 10. How it really works! DataContext and Local database relation Data Context Local Database LINQ TO SQL RUNTIME
  • 11. Define who goes where! LINQ to SQL mapping attributes Specify database-specific features such as tables, columns, primary keys, and indexes. DatabaseAttribute (Name) TableAttribute (Name) ColumnAttribute (AutoSync, IsForeignKey, DbType, IsVersion) AssociationAttribute (IsForeignKey, DeleteRule) DataAttribute (Storage)
  • 12. Teach LINQ TO SQL what to do PostId (Pk) PostContent Value (NOT NULL) (AUTOINCREMENT) (INT) Value Post Table
  • 13. Association (1 to many) PostId (Pk) PostContent BlogId Value (NOT NULL) (AUTOINCREMENT) (INT) Value value BlogId (Pk) BlogName Value (NOT NULL) (AUTOINCREMENT) (INT) Value Foreign Key Post table Blog table 1 M
  • 14. Association dissection! Foreign Key Navigational Property (Blog Reference) Post list reference
  • 15. Its time for CRUD
  • 16. CRUD with LINQ SELECT/RETRIEVE INSERT/CREATE UPDATE DELETE After All _blogPostDataContext.SubmitChanges();
  • 17. DEMO
  • 18. What you need to know when using database in WP 8.1 (WinRT)