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 4763 kmp ***

    找AEAEA形式的字符串最长的A长度,E可以为空 只可意会,不可言传,懂kmp即可 #include <stdio.h> #include <string.h> #includ ...

  2. 1:A+B Problem

    总时间限制:  1000ms  内存限制:  65536kB 描述 Calculate a + b 输入 Two integer a,,b (0 ≤ a,b ≤ 10) 输出 Output a + b ...

  3. map[C++]

    //map是一个存储键值对的容器,也是一个双向链表 #include <iostream> using namespace std; #include <map> int ma ...

  4. 允许webservice远程测试

    System.Web节点下添加 <webServices> <protocols> <add name= "HttpPost"/> <ad ...

  5. barabasilab-networkScience学习笔记6-evolving networks

    第一次接触复杂性科学是在一本叫think complexity的书上,Allen博士很好的讲述了数据结构与复杂性科学,barabasi是一个知名的复杂性网络科学家,barabasilab则是他所主导的 ...

  6. jquery中append()、prepend()、after()、before()的区别详解

    append() - 在被选元素的结尾插入内容(内容的结尾,比如说有个a标签,则是在</a>这个标签之前添加东西) prepend() - 在被选元素的开头插入内容(内容的开始,比如说有个 ...

  7. 【java基础】选择排序and冒泡排序

    前言 : 今天学习的是J2SE视频里的第五章,数组部分,它里面留了一个经典的作业,就是让我们去从1倒9按一定规格排序,这让我想起了学习vb的时候最最让我头疼的两种排序方法,选择排序法 和 冒泡排序法. ...

  8. Android拓展系列(11)--打造Windows下便携的Android源码阅读环境

    因为EXT和NTFS格式的差异,我一直对于windows下阅读Android源码感到不满. 前几天,想把最新的android5.0的源码下下来研究一下,而平时日常使用的又是windows环境,于是专门 ...

  9. Uva442 hdu 1082 Matrix Chain Multiplication

    要注意取出来的时候 先取出q的是后面那个矩阵 后取出p的是前面的矩阵 所以是判断 p.a == q.b #include <iostream> #include <stack> ...

  10. POJ 2002 统计正方形 HASH

    题目链接:http://poj.org/problem?id=2002 题意:给定n个点,问有多少种方法可以组成正方形. 思路:我们可以根据两个点求出对应正方形[有2个一个在两点左边,一个在两点右边] ...