Introduction of SQLite
SQLite is a lightweight, server-less database, it's great for embedding into client application. It works across Windows, iOS, Android, browers.
Code snippets
Create database connection
var connection = new SQLiteAsyncConnection("testdb.sqlite");
Create table
await connection.CreateTableAync<MyClass>();
Insert Data
await connection.InsertAsync(new MyClass());
Build up your class
public class MyClass
{
[PrimaryKey]
public string Id { get; set; }
public DateTime CreatedOn { get; set; }
public string Name { get; set; }
[Ignore]
public ComplexClass IgnoreMe { get; set; }
}
Querying
var items = connection.Table<MyClass>()
.Where(x=>x.Name == "Bob")
.FirstOrDefault();
Starting off
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("Assets\\dbfile.sqlite");
try
{
await file.CopyAsync(ApplicationData.Current.LocalFolder);
}
catch
{
}
sqlite:
sqlite-net:
https://github.com/praeclarum/sqlite-net
sqlite-net-wp8:
https://github.com/peterhuene/sqlite-net-wp8
Sample:
Introduction of SQLite的更多相关文章
- [转]MBTiles移动存储简介
首先奉上官网地址http://mapbox.com/developers/mbtiles/#storing_tiles 由于英文水平有限,看资料很费眼睛,特将它翻译成中文 存储瓦片 地图制作者面对一个 ...
- An Introduction To The SQLite C/C++ Interface
1. Summary The following two objects and eight methods comprise the essential elements of the SQLite ...
- [Sqlite3] Sqlite Introduction
Check whether you have sqlite3 installed: sqlite3 -version To create a new db: sqlite3 <filename. ...
- About SQLite
About SQLite See Also... Features When to use SQLite Frequently Asked Questions Well-known Users Boo ...
- C# & SQLite - Storing Images
Download source code - 755 KB Introduction This article is to demonstrate how to load images into ...
- SQLite Helper (C#) z
http://www.codeproject.com/Articles/746191/SQLite-Helper-Csharp Introduction I have written a small ...
- java链接sqlite资料整理
0.SQLite三种JDBC驱动的区别 摘自http://blog.sina.com.cn/s/blog_654337ca01016x4n.html 在DBeaver中看到SQLite有三种JDBC驱 ...
- dashDB - Introduction and DB Tools
dashDB - Introduction dashDB is a database that is designed for performance and scale. It offers sea ...
- Architecture of SQLite
Introduction This document describes the architecture of the SQLite library. The information here is ...
随机推荐
- Codeforces VK Cup 2012 Round 3 A. Variable, or There and Back Again(dfs)
题目链接:http://codeforces.com/problemset/problem/164/A 思路:用vector分别保留原图和发图,然后分别从val值为1的点正向遍历,va值为2的点反向遍 ...
- 如何安装Ecshop for linux
下载 http://update.shopex.com.cn/version/program/ECShop/download_ecshop_utf8.php 解压缩之后把upload文件夹中的内容放到 ...
- 【SQL 数据库】将一张数据表信息复制到另一张数据表
一.MySQL数据库 1.如果目标表存在 INSERT INTO 目标表 SELECT * FROM 源表; 2.如果目标表不存在 CREATE TABLE 目标表 SELECT * FROM ...
- telnet时显示:允许更多到 telnet 服务器的连接。请稍候再试
telnet时显示:允许更多到 telnet 服务器的连接.请稍候再试 解决办法: windows自带telnet服务器默认的最大连接数为2,要想修改该设置,可以在命令行键入tlntadmn c ...
- 快速幂 fast_exp
long long fast_exp(int base,long long exp,int mod) { long long ans=1LL,a=base; ) { if(exp&1LL) a ...
- python操作excel表格(xlrd/xlwt)
最近遇到一个情景,就是定期生成并发送服务器使用情况报表,按照不同维度统计,涉及python对excel的操作,上网搜罗了一番,大多大同小异,而且不太能满足需求,不过经过一番对源码的"研究&q ...
- SpringMyBatis解析4-MapperScannerConfigurer
如果有成百上千个dao接口呢,那我们岂不是要配置添加成百上千个bean,当然不是这样,spring还为MyBatis添加了拓展的功能,可以通过扫描包目录的方式,添加dao,让我看看具体使用和实现. & ...
- JQuery学习之jQuery尺寸
1.width()和height()方法: width():设置或返回元素的宽度(不包括内边距,边框或外边距) height():设置或返回元素的高度(不包括内边距,边框或外边距) $("b ...
- JSON 和 XML 优缺点的比较
JSON 和 XML 优缺点的比较 1.JSON定义(JavaScript Object Notation) 一种轻量级的数据交换格式,具有良好的可读和便于快速编写的特性.可在不同平台之间进行数据交换 ...
- SPOJ TSUM Triple Sums(FFT + 容斥)
题目 Source http://www.spoj.com/problems/TSUM/ Description You're given a sequence s of N distinct int ...