SlideShare ist ein Scribd-Unternehmen logo
1 von 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)

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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 사례
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Kürzlich hochgeladen (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

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)