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:

http://www.sqlite.org/

sqlite-net:

https://github.com/praeclarum/sqlite-net

sqlite-net-wp8:

https://github.com/peterhuene/sqlite-net-wp8

Sample:

http://bit.ly/TLWrZw

Introduction of SQLite的更多相关文章

  1. [转]MBTiles移动存储简介

    首先奉上官网地址http://mapbox.com/developers/mbtiles/#storing_tiles 由于英文水平有限,看资料很费眼睛,特将它翻译成中文 存储瓦片 地图制作者面对一个 ...

  2. An Introduction To The SQLite C/C++ Interface

    1. Summary The following two objects and eight methods comprise the essential elements of the SQLite ...

  3. [Sqlite3] Sqlite Introduction

    Check whether you have sqlite3 installed: sqlite3 -version To create a new db: sqlite3 <filename. ...

  4. About SQLite

    About SQLite See Also... Features When to use SQLite Frequently Asked Questions Well-known Users Boo ...

  5. C# & SQLite - Storing Images

      Download source code - 755 KB Introduction This article is to demonstrate how to load images into ...

  6. SQLite Helper (C#) z

    http://www.codeproject.com/Articles/746191/SQLite-Helper-Csharp Introduction I have written a small ...

  7. java链接sqlite资料整理

    0.SQLite三种JDBC驱动的区别 摘自http://blog.sina.com.cn/s/blog_654337ca01016x4n.html 在DBeaver中看到SQLite有三种JDBC驱 ...

  8. dashDB - Introduction and DB Tools

    dashDB - Introduction dashDB is a database that is designed for performance and scale. It offers sea ...

  9. Architecture of SQLite

    Introduction This document describes the architecture of the SQLite library. The information here is ...

随机推荐

  1. hdu 1517 博弈 **

    博弈题: 题意:2 个人玩游戏,从 1 开始,轮流对数进行累乘,直到超过一个指定的值. 解题思路:如果输入是 2 ~ 9 ,因为Stan 是先手,所以Stan 必胜如果输入是 10~18 ,因为Oll ...

  2. pythonchallenge之C++学习篇-03

    提示说一个小写字母两面精确地被大写字母包围,应该指的是周围没有四个而仅仅这两个像这样的:xXXXxXXXx的中间的那个应该是符合条件的 好了标题是re,提示该是使用正则表达式,网页源码里有待处理的字符 ...

  3. LOAD和PigStorage的一些测试例子 (转)

    原地址:http://f.dataguru.cn/thread-233064-1-1.htm 因为理解上的错误,在这里被搞糊涂了.通过做测试,应该算是澄清了,所以写出来. 假设有个文件叫test,该文 ...

  4. 《DSP using MATLAB》示例Example4.13

    代码: b = [1, 0, -1]; a = [1, 0, -0.81]; % [R, p, C] = residuez(b,a); Mp = (abs(p))' Ap = (angle(p))'/ ...

  5. 《DSP using MATLAB》示例Example4.7

    ROC分三种情况:

  6. 用js刷题的一些坑

    leecode可以用js刷题了,我大js越来越被认可了是吧.但是刷题中会因为忽略js的一些特性掉入坑里.我这里总结一下我掉过的坑. 坑1:js中数组对象是引用对象 js中除了object还有数组对象也 ...

  7. css自适应代码-iphone端

    @media (device-height:480px) and (-webkit-min-device-pixel-ratio:2) {/* 兼容iphone4/4s */} @media (dev ...

  8. 【CLR in c#】参数

    1.可选参数和命名参数 设计一个参数时,可为部分或全部参数分配默认值,调用这些方法的代码可以选择不指定部分实参,接受默认值,还可以通过制定参数名称的方式传递实参.如下 class CLR可选参数 { ...

  9. AngularJS html+DOM+ng-click事件

    ng-disabled 指令直接绑定应用程序数据到 HTML 的 disabled 属性. ng-show 指令用于设置应用部分是否可见. ng-show="true" 设置 HT ...

  10. 【面经】用递归方法对二叉树进行层次遍历 && 二叉树深度

    void PrintNodeAtLevel(BiTree T,int level) { // 空树或层级不合理 ) return; == level) { cout << T->da ...