SlideShare a Scribd company logo
Prepared by
ENG SOON CHEAH
Microsoft MVP
Install SQLite-UAP extensions form NuGet Package Manager
Next Install SQLite.Net-PCL extension from NuGet Package
• Include 4 functions CRUD Operations
• Bind data to a ListBox
<Grid Background="#FFF589E2">
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Button x:Name="CreateDBbutton" Grid.Row="0" Content="Create Local Database" HorizontalAlignment="Center"
VerticalAlignment="Top" Click="button_Click" />
<Button x:Name="create" Grid.Row="1" Content="Create New Students" HorizontalAlignment="Center" Click="creat
e_Click"></Button>
<Button x:Name="read" Grid.Row="2" Content="Read Students List" Width="300" Click="read_Click" HorizontalAlig
nment="Center"></Button>
<Button x:Name="update" Grid.Row="3" Content="Update Details" Width="300" Click="update_Click" HorizontalAli
gnment="Stretch"></Button>
<ListView x:Name="allstudents" HorizontalAlignment="Stretch" Grid.Row="4">
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock x:Name="ee" Text="{Binding Name}" FontSize="14"></TextBlock>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
public class Students
{
[SQLite.Net.Attributes.PrimaryKey, SQLite.Net.Attributes.AutoIncrement]
public int Id
{
get;
set;
}
public string Name
{
get;
set;
}
public string Address
{
get;
set;
}
public string Mobile
{
get;
set;
}
public Students()
{}
public Students(string name, string address, string mobile)
{
Name = name;
Address = address;
Mobile = mobile;
}
}
public static void CreateDatabase()
{
var sqlpath = System.IO.Path.Combine(Windows.Stora
ge.ApplicationData.Current.LocalFolder.Path, "Studentdb.
sqlite");
using(SQLite.Net.SQLiteConnection conn = new SQLit
e.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.
SQLitePlatformWinRT(), sqlpath))
{
conn.CreateTable < Students > ();
}
}
public void Insert(Students objContact)
{
var sqlpath = System.IO.Path.Combine(Windows.Storage.Appli
cationData.Current.LocalFolder.Path, "Studentdb.sqlite");
using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.S
QLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatform
WinRT(), sqlpath))
{
conn.RunInTransaction(() =>
{
conn.Insert(objContact);
});
}
}
// Retrieve the specific contact from the database.
public Students ReadContact(int contactid)
{
var sqlpath = System.IO.Path.Combine(Windows.Storage.Appli
cationData.Current.LocalFolder.Path, "Studentdb.sqlite");
using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.S
QLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatform
WinRT(), sqlpath))
{
var existingconact = conn.Query < Students > ("select * fro
m Students where Id =" + contactid).FirstOrDefault();
return existingconact;
}
}
//Read All Student details
public ObservableCollection < Students > ReadAllStudents()
{
var sqlpath = System.IO.Path.Combine(Windows.Storage.ApplicationData.Cur
rent.LocalFolder.Path, "Studentdb.sqlite");
using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnectio
n(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), sqlpath))
{
List < Students > myCollection = conn.Table < Students > ().ToList < Stud
ents > ();
ObservableCollection < Students > StudentsList = new ObservableCollecti
on < Students > (myCollection);
return StudentsList;
}
}
//Update student detaisl
public void UpdateDetails(string name)
{
var sqlpath = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "Student
db.sqlite");
using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.Win
RT.SQLitePlatformWinRT(), sqlpath))
{
var existingconact = conn.Query < Students > ("select * from Students where Name =" + name).FirstOrDe
fault();
if (existingconact != null)
{
existingconact.Name = name;
existingconact.Address = "NewAddress";
existingconact.Mobile = "962623233";
conn.RunInTransaction(() =>
{
conn.Update(existingconact);
});
}
}
}
//Delete all student or delete student table
public void DeleteAllContact()
{
var sqlpath = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "Studentdb.sqlite");
using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformW
inRT(), sqlpath))
{
conn.DropTable < Students > ();
conn.CreateTable < Students > ();
conn.Dispose();
conn.Close();
}
}
Delete specific student
//Delete specific student
public void DeleteContact(int Id)
{
var sqlpath = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "Studentdb.sqlite");
using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformW
inRT(), sqlpath))
{
var existingconact = conn.Query < Students > ("select * from Studentdb where Id =" + Id).FirstOrDefault();
if (existingconact != null)
{
conn.RunInTransaction(() =>
{
conn.Delete(existingconact);
});
}
}
}
• Local Data Base SQLite for Windows 10
https://code.msdn.microsoft.com/Local-
Data-Base-SQLite-for-5e6146aa

More Related Content

What's hot

Ajax chap 3
Ajax chap 3Ajax chap 3
Ajax chap 3
Mukesh Tekwani
 
Sql lite android
Sql lite androidSql lite android
Sql lite android
Dushyant Nasit
 
Android datastorage
Android datastorageAndroid datastorage
Android datastorage
Krazy Koder
 
The Ring programming language version 1.5.3 book - Part 28 of 184
The Ring programming language version 1.5.3 book - Part 28 of 184The Ring programming language version 1.5.3 book - Part 28 of 184
The Ring programming language version 1.5.3 book - Part 28 of 184
Mahmoud Samir Fayed
 
Local Storage
Local StorageLocal Storage
Local Storage
Ivano Malavolta
 
Sequelize
SequelizeSequelize
Sequelize
Tarek Raihan
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
Sourabh Sahu
 
Database connectivity in python
Database connectivity in pythonDatabase connectivity in python
Database connectivity in python
baabtra.com - No. 1 supplier of quality freshers
 
Кирилл Латыш "ERP on Websockets"
Кирилл Латыш "ERP on Websockets"Кирилл Латыш "ERP on Websockets"
Кирилл Латыш "ERP on Websockets"
Fwdays
 
บทที่ 4 การเพิ่มข้อมูลลงฐานข้อมูล
บทที่ 4 การเพิ่มข้อมูลลงฐานข้อมูลบทที่ 4 การเพิ่มข้อมูลลงฐานข้อมูล
บทที่ 4 การเพิ่มข้อมูลลงฐานข้อมูล
Priew Chakrit
 
Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access
Rebecca Grenier
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate Tutorial
Syed Shahul
 
22jdbc
22jdbc22jdbc
22jdbc
Adil Jafri
 
Jdbc oracle
Jdbc oracleJdbc oracle
Jdbc oracle
yazidds2
 
Accessing data with android cursors
Accessing data with android cursorsAccessing data with android cursors
Accessing data with android cursors
info_zybotech
 
REST Basics
REST BasicsREST Basics
REST Basics
Ivano Malavolta
 
DIY Percolator
DIY PercolatorDIY Percolator
DIY Percolator
jdhok
 

What's hot (18)

Ajax chap 3
Ajax chap 3Ajax chap 3
Ajax chap 3
 
Sql lite android
Sql lite androidSql lite android
Sql lite android
 
Android datastorage
Android datastorageAndroid datastorage
Android datastorage
 
The Ring programming language version 1.5.3 book - Part 28 of 184
The Ring programming language version 1.5.3 book - Part 28 of 184The Ring programming language version 1.5.3 book - Part 28 of 184
The Ring programming language version 1.5.3 book - Part 28 of 184
 
Local Storage
Local StorageLocal Storage
Local Storage
 
Sequelize
SequelizeSequelize
Sequelize
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
 
Database connectivity in python
Database connectivity in pythonDatabase connectivity in python
Database connectivity in python
 
Кирилл Латыш "ERP on Websockets"
Кирилл Латыш "ERP on Websockets"Кирилл Латыш "ERP on Websockets"
Кирилл Латыш "ERP on Websockets"
 
บทที่ 4 การเพิ่มข้อมูลลงฐานข้อมูล
บทที่ 4 การเพิ่มข้อมูลลงฐานข้อมูลบทที่ 4 การเพิ่มข้อมูลลงฐานข้อมูล
บทที่ 4 การเพิ่มข้อมูลลงฐานข้อมูล
 
Insert
InsertInsert
Insert
 
Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate Tutorial
 
22jdbc
22jdbc22jdbc
22jdbc
 
Jdbc oracle
Jdbc oracleJdbc oracle
Jdbc oracle
 
Accessing data with android cursors
Accessing data with android cursorsAccessing data with android cursors
Accessing data with android cursors
 
REST Basics
REST BasicsREST Basics
REST Basics
 
DIY Percolator
DIY PercolatorDIY Percolator
DIY Percolator
 

Viewers also liked

Windows 10 (UWP) App Development
Windows 10 (UWP) App DevelopmentWindows 10 (UWP) App Development
Windows 10 (UWP) App Development
Cheah Eng Soon
 
Introduction to universal windows platform(uwp) app development
Introduction to universal windows platform(uwp) app developmentIntroduction to universal windows platform(uwp) app development
Introduction to universal windows platform(uwp) app development
Thilina Wijerathne
 
Social media 1 introduction
Social media 1 introductionSocial media 1 introduction
Social media 1 introduction
Donald Young
 
Slide
SlideSlide
Slide
tmalloy1
 
Lobbying Rules Nonprofits
Lobbying Rules NonprofitsLobbying Rules Nonprofits
Lobbying Rules Nonprofits
Tate Tryon CPAs
 
Nt Cadcam Powerpoint For Linked In
Nt Cadcam Powerpoint For Linked InNt Cadcam Powerpoint For Linked In
Nt Cadcam Powerpoint For Linked In
m4ttyj17
 
Place Value Curriculum Map (published version)
Place Value Curriculum Map (published version)Place Value Curriculum Map (published version)
Place Value Curriculum Map (published version)
Becky Kimball
 
Lady gaga vs Katy Perry 2013
Lady gaga  vs  Katy Perry 2013Lady gaga  vs  Katy Perry 2013
Lady gaga vs Katy Perry 2013
Maru Romano
 
IILIV_M4C4 Lezione 5. lavoro di rete e docente specializzato
IILIV_M4C4 Lezione 5. lavoro di rete e docente specializzatoIILIV_M4C4 Lezione 5. lavoro di rete e docente specializzato
IILIV_M4C4 Lezione 5. lavoro di rete e docente specializzato
raffaelebruno1
 
Mulheres na CI&T e o desafio das duas mil
Mulheres na CI&T e o desafio das duas milMulheres na CI&T e o desafio das duas mil
Mulheres na CI&T e o desafio das duas mil
Marilia Honorio
 
Repaso de para empezar
Repaso de para empezarRepaso de para empezar
Repaso de para empezar
larrylayfield
 
Naatal14
Naatal14Naatal14
Naatal14
Carlos Jorge
 
12 prerada voca i grozdja
12  prerada voca i grozdja12  prerada voca i grozdja
12 prerada voca i grozdja
Lelita Sanches
 
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motorAdafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Stefan Oprea
 
Сучасна бібліотека на захисті прав молоді: проект Великоолександрівської цент...
Сучасна бібліотека на захисті прав молоді: проект Великоолександрівської цент...Сучасна бібліотека на захисті прав молоді: проект Великоолександрівської цент...
Сучасна бібліотека на захисті прав молоді: проект Великоолександрівської цент...
Irina Taradyamenko
 

Viewers also liked (15)

Windows 10 (UWP) App Development
Windows 10 (UWP) App DevelopmentWindows 10 (UWP) App Development
Windows 10 (UWP) App Development
 
Introduction to universal windows platform(uwp) app development
Introduction to universal windows platform(uwp) app developmentIntroduction to universal windows platform(uwp) app development
Introduction to universal windows platform(uwp) app development
 
Social media 1 introduction
Social media 1 introductionSocial media 1 introduction
Social media 1 introduction
 
Slide
SlideSlide
Slide
 
Lobbying Rules Nonprofits
Lobbying Rules NonprofitsLobbying Rules Nonprofits
Lobbying Rules Nonprofits
 
Nt Cadcam Powerpoint For Linked In
Nt Cadcam Powerpoint For Linked InNt Cadcam Powerpoint For Linked In
Nt Cadcam Powerpoint For Linked In
 
Place Value Curriculum Map (published version)
Place Value Curriculum Map (published version)Place Value Curriculum Map (published version)
Place Value Curriculum Map (published version)
 
Lady gaga vs Katy Perry 2013
Lady gaga  vs  Katy Perry 2013Lady gaga  vs  Katy Perry 2013
Lady gaga vs Katy Perry 2013
 
IILIV_M4C4 Lezione 5. lavoro di rete e docente specializzato
IILIV_M4C4 Lezione 5. lavoro di rete e docente specializzatoIILIV_M4C4 Lezione 5. lavoro di rete e docente specializzato
IILIV_M4C4 Lezione 5. lavoro di rete e docente specializzato
 
Mulheres na CI&T e o desafio das duas mil
Mulheres na CI&T e o desafio das duas milMulheres na CI&T e o desafio das duas mil
Mulheres na CI&T e o desafio das duas mil
 
Repaso de para empezar
Repaso de para empezarRepaso de para empezar
Repaso de para empezar
 
Naatal14
Naatal14Naatal14
Naatal14
 
12 prerada voca i grozdja
12  prerada voca i grozdja12  prerada voca i grozdja
12 prerada voca i grozdja
 
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motorAdafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motor
 
Сучасна бібліотека на захисті прав молоді: проект Великоолександрівської цент...
Сучасна бібліотека на захисті прав молоді: проект Великоолександрівської цент...Сучасна бібліотека на захисті прав молоді: проект Великоолександрівської цент...
Сучасна бібліотека на захисті прав молоді: проект Великоолександрівської цент...
 

Similar to SQLite with UWP

Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015
Svetlin Nakov
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
pootsbook
 
Web based development
Web based developmentWeb based development
Web based development
Mumbai Academisc
 
Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIR
Peter Elst
 
Scala based Lift Framework
Scala based Lift FrameworkScala based Lift Framework
Scala based Lift Framework
vhazrati
 
Overview Of Lift Framework
Overview Of Lift FrameworkOverview Of Lift Framework
Overview Of Lift Framework
Xebia IT Architects
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web Framework
IndicThreads
 
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02
Rati Manandhar
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
Spiffy
 
Selenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkSelenium Webdriver with data driven framework
Selenium Webdriver with data driven framework
David Rajah Selvaraj
 
Javascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JSJavascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JS
Min Ming Lo
 
JDBC Connecticity.ppt
JDBC Connecticity.pptJDBC Connecticity.ppt
JDBC Connecticity.ppt
Swapnil Kale
 
Step By Step Guide For Buidling Simple Struts App
Step By Step Guide For Buidling Simple Struts AppStep By Step Guide For Buidling Simple Struts App
Step By Step Guide For Buidling Simple Struts App
Syed Shahul
 
Django quickstart
Django quickstartDjango quickstart
Django quickstart
Marconi Moreto
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
zeeshanhanif
 
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1
Zianed Hou
 
Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1
Kevin Octavian
 
Mvc4 crud operations.-kemuning senja
Mvc4 crud operations.-kemuning senjaMvc4 crud operations.-kemuning senja
Mvc4 crud operations.-kemuning senja
alifha12
 
JDBC Tutorial
JDBC TutorialJDBC Tutorial
JDBC Tutorial
Information Technology
 
Database connectivity in python
Database connectivity in pythonDatabase connectivity in python
Database connectivity in python
baabtra.com - No. 1 supplier of quality freshers
 

Similar to SQLite with UWP (20)

Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
Web based development
Web based developmentWeb based development
Web based development
 
Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIR
 
Scala based Lift Framework
Scala based Lift FrameworkScala based Lift Framework
Scala based Lift Framework
 
Overview Of Lift Framework
Overview Of Lift FrameworkOverview Of Lift Framework
Overview Of Lift Framework
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web Framework
 
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
 
Selenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkSelenium Webdriver with data driven framework
Selenium Webdriver with data driven framework
 
Javascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JSJavascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JS
 
JDBC Connecticity.ppt
JDBC Connecticity.pptJDBC Connecticity.ppt
JDBC Connecticity.ppt
 
Step By Step Guide For Buidling Simple Struts App
Step By Step Guide For Buidling Simple Struts AppStep By Step Guide For Buidling Simple Struts App
Step By Step Guide For Buidling Simple Struts App
 
Django quickstart
Django quickstartDjango quickstart
Django quickstart
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
 
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1
 
Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1
 
Mvc4 crud operations.-kemuning senja
Mvc4 crud operations.-kemuning senjaMvc4 crud operations.-kemuning senja
Mvc4 crud operations.-kemuning senja
 
JDBC Tutorial
JDBC TutorialJDBC Tutorial
JDBC Tutorial
 
Database connectivity in python
Database connectivity in pythonDatabase connectivity in python
Database connectivity in python
 

More from Cheah Eng Soon

Microsoft Defender for Endpoint
Microsoft Defender for EndpointMicrosoft Defender for Endpoint
Microsoft Defender for Endpoint
Cheah Eng Soon
 
Azure Active Directory - Secure and Govern
Azure Active Directory - Secure and GovernAzure Active Directory - Secure and Govern
Azure Active Directory - Secure and Govern
Cheah Eng Soon
 
Microsoft Zero Trust
Microsoft Zero TrustMicrosoft Zero Trust
Microsoft Zero Trust
Cheah Eng Soon
 
MEM for OnPrem Environments
MEM for OnPrem EnvironmentsMEM for OnPrem Environments
MEM for OnPrem Environments
Cheah Eng Soon
 
Microsoft Threat Protection Automated Incident Response
Microsoft Threat Protection Automated Incident Response Microsoft Threat Protection Automated Incident Response
Microsoft Threat Protection Automated Incident Response
Cheah Eng Soon
 
Azure Penetration Testing
Azure Penetration TestingAzure Penetration Testing
Azure Penetration Testing
Cheah Eng Soon
 
Azure Penetration Testing
Azure Penetration TestingAzure Penetration Testing
Azure Penetration Testing
Cheah Eng Soon
 
Penetration Testing Azure for Ethical Hackers
Penetration Testing Azure for Ethical HackersPenetration Testing Azure for Ethical Hackers
Penetration Testing Azure for Ethical Hackers
Cheah Eng Soon
 
Microsoft Threat Protection Automated Incident Response Demo
Microsoft Threat Protection Automated Incident Response DemoMicrosoft Threat Protection Automated Incident Response Demo
Microsoft Threat Protection Automated Incident Response Demo
Cheah Eng Soon
 
Microsoft Secure Score Demo
Microsoft Secure Score DemoMicrosoft Secure Score Demo
Microsoft Secure Score Demo
Cheah Eng Soon
 
Microsoft Cloud App Security Demo
Microsoft Cloud App Security DemoMicrosoft Cloud App Security Demo
Microsoft Cloud App Security Demo
Cheah Eng Soon
 
M365 Attack Simulation Demo
M365 Attack Simulation DemoM365 Attack Simulation Demo
M365 Attack Simulation Demo
Cheah Eng Soon
 
Cloud Security Demo
Cloud Security DemoCloud Security Demo
Cloud Security Demo
Cheah Eng Soon
 
Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo
Cheah Eng Soon
 
Azure WAF
Azure WAFAzure WAF
Azure WAF
Cheah Eng Soon
 
Azure Weekend 2020 Build Malaysia Bus Uncle Chatbot
Azure Weekend 2020 Build Malaysia Bus Uncle ChatbotAzure Weekend 2020 Build Malaysia Bus Uncle Chatbot
Azure Weekend 2020 Build Malaysia Bus Uncle Chatbot
Cheah Eng Soon
 
Microsoft Azure的20大常见安全漏洞与配置错误
Microsoft Azure的20大常见安全漏洞与配置错误Microsoft Azure的20大常见安全漏洞与配置错误
Microsoft Azure的20大常见安全漏洞与配置错误
Cheah Eng Soon
 
20 common security vulnerabilities and misconfiguration in Azure
20 common security vulnerabilities and misconfiguration in Azure20 common security vulnerabilities and misconfiguration in Azure
20 common security vulnerabilities and misconfiguration in Azure
Cheah Eng Soon
 
Integrate Microsoft Graph with Azure Bot Services
Integrate Microsoft Graph with Azure Bot ServicesIntegrate Microsoft Graph with Azure Bot Services
Integrate Microsoft Graph with Azure Bot Services
Cheah Eng Soon
 
Azure Sentinel with Office 365
Azure Sentinel with Office 365Azure Sentinel with Office 365
Azure Sentinel with Office 365
Cheah Eng Soon
 

More from Cheah Eng Soon (20)

Microsoft Defender for Endpoint
Microsoft Defender for EndpointMicrosoft Defender for Endpoint
Microsoft Defender for Endpoint
 
Azure Active Directory - Secure and Govern
Azure Active Directory - Secure and GovernAzure Active Directory - Secure and Govern
Azure Active Directory - Secure and Govern
 
Microsoft Zero Trust
Microsoft Zero TrustMicrosoft Zero Trust
Microsoft Zero Trust
 
MEM for OnPrem Environments
MEM for OnPrem EnvironmentsMEM for OnPrem Environments
MEM for OnPrem Environments
 
Microsoft Threat Protection Automated Incident Response
Microsoft Threat Protection Automated Incident Response Microsoft Threat Protection Automated Incident Response
Microsoft Threat Protection Automated Incident Response
 
Azure Penetration Testing
Azure Penetration TestingAzure Penetration Testing
Azure Penetration Testing
 
Azure Penetration Testing
Azure Penetration TestingAzure Penetration Testing
Azure Penetration Testing
 
Penetration Testing Azure for Ethical Hackers
Penetration Testing Azure for Ethical HackersPenetration Testing Azure for Ethical Hackers
Penetration Testing Azure for Ethical Hackers
 
Microsoft Threat Protection Automated Incident Response Demo
Microsoft Threat Protection Automated Incident Response DemoMicrosoft Threat Protection Automated Incident Response Demo
Microsoft Threat Protection Automated Incident Response Demo
 
Microsoft Secure Score Demo
Microsoft Secure Score DemoMicrosoft Secure Score Demo
Microsoft Secure Score Demo
 
Microsoft Cloud App Security Demo
Microsoft Cloud App Security DemoMicrosoft Cloud App Security Demo
Microsoft Cloud App Security Demo
 
M365 Attack Simulation Demo
M365 Attack Simulation DemoM365 Attack Simulation Demo
M365 Attack Simulation Demo
 
Cloud Security Demo
Cloud Security DemoCloud Security Demo
Cloud Security Demo
 
Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo
 
Azure WAF
Azure WAFAzure WAF
Azure WAF
 
Azure Weekend 2020 Build Malaysia Bus Uncle Chatbot
Azure Weekend 2020 Build Malaysia Bus Uncle ChatbotAzure Weekend 2020 Build Malaysia Bus Uncle Chatbot
Azure Weekend 2020 Build Malaysia Bus Uncle Chatbot
 
Microsoft Azure的20大常见安全漏洞与配置错误
Microsoft Azure的20大常见安全漏洞与配置错误Microsoft Azure的20大常见安全漏洞与配置错误
Microsoft Azure的20大常见安全漏洞与配置错误
 
20 common security vulnerabilities and misconfiguration in Azure
20 common security vulnerabilities and misconfiguration in Azure20 common security vulnerabilities and misconfiguration in Azure
20 common security vulnerabilities and misconfiguration in Azure
 
Integrate Microsoft Graph with Azure Bot Services
Integrate Microsoft Graph with Azure Bot ServicesIntegrate Microsoft Graph with Azure Bot Services
Integrate Microsoft Graph with Azure Bot Services
 
Azure Sentinel with Office 365
Azure Sentinel with Office 365Azure Sentinel with Office 365
Azure Sentinel with Office 365
 

Recently uploaded

Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 

Recently uploaded (20)

Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 

SQLite with UWP

  • 1. Prepared by ENG SOON CHEAH Microsoft MVP
  • 2. Install SQLite-UAP extensions form NuGet Package Manager
  • 3. Next Install SQLite.Net-PCL extension from NuGet Package
  • 4. • Include 4 functions CRUD Operations • Bind data to a ListBox
  • 5. <Grid Background="#FFF589E2"> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="*"></RowDefinition> </Grid.RowDefinitions> <Button x:Name="CreateDBbutton" Grid.Row="0" Content="Create Local Database" HorizontalAlignment="Center" VerticalAlignment="Top" Click="button_Click" /> <Button x:Name="create" Grid.Row="1" Content="Create New Students" HorizontalAlignment="Center" Click="creat e_Click"></Button> <Button x:Name="read" Grid.Row="2" Content="Read Students List" Width="300" Click="read_Click" HorizontalAlig nment="Center"></Button> <Button x:Name="update" Grid.Row="3" Content="Update Details" Width="300" Click="update_Click" HorizontalAli gnment="Stretch"></Button> <ListView x:Name="allstudents" HorizontalAlignment="Stretch" Grid.Row="4"> <ListView.ItemTemplate> <DataTemplate> <TextBlock x:Name="ee" Text="{Binding Name}" FontSize="14"></TextBlock> </DataTemplate> </ListView.ItemTemplate> </ListView> </Grid>
  • 6. public class Students { [SQLite.Net.Attributes.PrimaryKey, SQLite.Net.Attributes.AutoIncrement] public int Id { get; set; } public string Name { get; set; } public string Address { get; set; } public string Mobile { get; set; } public Students() {} public Students(string name, string address, string mobile) { Name = name; Address = address; Mobile = mobile; } }
  • 7. public static void CreateDatabase() { var sqlpath = System.IO.Path.Combine(Windows.Stora ge.ApplicationData.Current.LocalFolder.Path, "Studentdb. sqlite"); using(SQLite.Net.SQLiteConnection conn = new SQLit e.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT. SQLitePlatformWinRT(), sqlpath)) { conn.CreateTable < Students > (); } }
  • 8. public void Insert(Students objContact) { var sqlpath = System.IO.Path.Combine(Windows.Storage.Appli cationData.Current.LocalFolder.Path, "Studentdb.sqlite"); using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.S QLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatform WinRT(), sqlpath)) { conn.RunInTransaction(() => { conn.Insert(objContact); }); } }
  • 9. // Retrieve the specific contact from the database. public Students ReadContact(int contactid) { var sqlpath = System.IO.Path.Combine(Windows.Storage.Appli cationData.Current.LocalFolder.Path, "Studentdb.sqlite"); using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.S QLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatform WinRT(), sqlpath)) { var existingconact = conn.Query < Students > ("select * fro m Students where Id =" + contactid).FirstOrDefault(); return existingconact; } }
  • 10. //Read All Student details public ObservableCollection < Students > ReadAllStudents() { var sqlpath = System.IO.Path.Combine(Windows.Storage.ApplicationData.Cur rent.LocalFolder.Path, "Studentdb.sqlite"); using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnectio n(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), sqlpath)) { List < Students > myCollection = conn.Table < Students > ().ToList < Stud ents > (); ObservableCollection < Students > StudentsList = new ObservableCollecti on < Students > (myCollection); return StudentsList; } }
  • 11. //Update student detaisl public void UpdateDetails(string name) { var sqlpath = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "Student db.sqlite"); using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.Win RT.SQLitePlatformWinRT(), sqlpath)) { var existingconact = conn.Query < Students > ("select * from Students where Name =" + name).FirstOrDe fault(); if (existingconact != null) { existingconact.Name = name; existingconact.Address = "NewAddress"; existingconact.Mobile = "962623233"; conn.RunInTransaction(() => { conn.Update(existingconact); }); } } }
  • 12. //Delete all student or delete student table public void DeleteAllContact() { var sqlpath = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "Studentdb.sqlite"); using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformW inRT(), sqlpath)) { conn.DropTable < Students > (); conn.CreateTable < Students > (); conn.Dispose(); conn.Close(); } } Delete specific student //Delete specific student public void DeleteContact(int Id) { var sqlpath = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "Studentdb.sqlite"); using(SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformW inRT(), sqlpath)) { var existingconact = conn.Query < Students > ("select * from Studentdb where Id =" + Id).FirstOrDefault(); if (existingconact != null) { conn.RunInTransaction(() => { conn.Delete(existingconact); }); } } }
  • 13. • Local Data Base SQLite for Windows 10 https://code.msdn.microsoft.com/Local- Data-Base-SQLite-for-5e6146aa