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 ...
随机推荐
- [Eclipse] Eclipse is running in a JRE, but a JDK is required
安装Maven后每次启动出现警告信息: Eclipse is running in a JRE, but a JDK is required Some Maven plugins may not wo ...
- IIS配置php运行环境默认加载的php.ini路径
第一步: 把PHP的安装路径添加到环境变量Path中,右键 “我的电脑” -> 高级 -> 环境变量 -> 系统变量,追加 D:PHP-5.2.8\; 第二步: 新建“系统变量” P ...
- loj 1379(最短路变形)
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=27087 思路:题目的意思是求S->T的所有路径中花费总和小于 ...
- 使用openface(linux)
在github上搜索openface,clone下来; 按照requirement.txt中安装需要的项: sudo apt-get install .... sudo pip install ... ...
- css样式—字体垂直、水平居中
“来,老板娘,给个div瞅瞅”: “好的,宇哥,来了了了”: <div class="tt">啦啦啦</div> “给各样啊,我去”: “是”: .tt{ ...
- jquery mousewheel
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js&quo ...
- c#中ref和out 关键字
问题:为什么c#中要有ref和out?(而java中没有)需求假设:现需要通过一个叫Swap的方法交换a,b两个变量的值.交换前a=1,b=2,断言:交换后a=2,b=1. 现编码如下: class ...
- 非传统题【A002】
[A002]非传统题[难度A]————————————————————————————————————————————————————————————————————————————————————— ...
- Java学习——开端
学号 <Java程序设计>第1周学习总结(1) 教材学习内容总结(第一章) Java最早是由Sun公司研发,原称Oak(橡树),开发者之一的James Gosling被尊称为Java之父. ...
- 转:Docker学习---挂载本地目录
原文: http://my.oschina.net/piorcn/blog/324202 docker可以支持把一个宿主机上的目录挂载到镜像里 docker run -it -v /home/dock ...