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. wp8 入门到精通 聊天控件

    <Grid > <Grid x:Name="bubble_right" VerticalAlignment="Center" RenderTr ...

  2. WPF Navigation

    在开始学习WPF时,一开始对WPF的Window, Page, UserControl感到很迷惑.不知道什么时候该使用哪一个.下面简单介绍一下这三者的区别. Window:故名思意,桌面程序的窗体.在 ...

  3. 把VSO作为GitHub上JavaScript项目的免费CI服务器

    (此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:微软变得更加开放后,走向开放的不仅有.NET运行时.IDE工具,还有ALM服务器核心组 ...

  4. UDP穿透NAT原理解析

    转自:http://www.2cto.com/net/201201/116793.html NAT(Network Address Translators),网络地址转换:网络地址转换是在IP地址日益 ...

  5. 总结列表显示ListView知识点

    全选ListView的item条目 单选ListView的条目 多选ListView的item条目 自定义ArrayAdapter动态改变ListView的不同item样式 动态增加和删除ListVi ...

  6. loj 1426(dfs + bfs)

    题目链接:http://lightoj.com/volume_showproblem.php?problem=1426 思路:首先我们预处理出每一个"*"在某一方向上最终能到达的位 ...

  7. zTree学习文档和DEOM

    http://tool.oschina.net/apidocs/apidoc?api=ztree3.2%2Fapi%2FAPI_cn.html zTree的API http://www.ztree.m ...

  8. Java学习笔记(六)——方法

    一.方法定义 1.语法: 其中: (1) 访问修饰符:方法允许被访问的权限范围, 可以是 public.protected.private 甚至可以省略 ,其中 public 表示该方法可以被其他任何 ...

  9. Linux内核system_call中断处理过程

    “平安的祝福 + 原创作品转载请注明出处 + <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 ” men ...

  10. 【T_SQL】 基础 事务

    1.使用 T-SQL 语句来管理事务       开始事务:BEGIN TRANSACTION       提交事务:COMMIT TRANSACTION       回滚(撤销)事务:ROLLBAC ...