sqlite and the.net framework this ppt: http:

11
SQLite and the .NET Framework This PPT: Http://www.eggheadcafe.com/articles/SQLite.ppt

Upload: lizbeth-fletcher

Post on 23-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SQLite and the.NET Framework This PPT: Http:

SQLite and the .NET Framework

This PPT: Http://www.eggheadcafe.com/articles/SQLite.ppt

Page 2: SQLite and the.NET Framework This PPT: Http:

What is SQLite? SQLite is a small C library that implements a

self-contained, embeddable, zero-configuration SQL database engine. Transactions are atomic, consistent, isolated, and durable

(ACID) even after system crashes and power failures. Zero-configuration - no setup or administration needed. Implements most of SQL92. A complete database is stored in a single disk file. Database files can be freely shared between machines with

different byte orders. Supports databases up to 2 terabytes (241 bytes) in size. Sizes of strings and BLOBs limited only by available memory.

Page 3: SQLite and the.NET Framework This PPT: Http:

What is SQLite – continued

Faster than popular client/server database engines for most common operations.

Simple, easy to use API. Bindings for many languages available Well-commented source code with over 95% test coverage. Self-contained: no external dependencies. Sources are in the public domain. Use for any purpose. There is now a robust SQLite.NET ADO.NET provider! Small code footprint: less than 30K lines of C code, less than

250KB code space Installation: Just set “Build Action” to “Content” on Database file!

Page 4: SQLite and the.NET Framework This PPT: Http:

More SQLite Features Create Database Programmatically in

Connection stringNo need to distribute or install databaseSQL to create database, tables, triggers can

be embedded Triggers

Triggers can be used to handle many of the functions of stored procedures.

Vacuum Just like “Compact Database” in MS Access.

Page 5: SQLite and the.NET Framework This PPT: Http:

The SQLite ADO.NET Provider

Conforms to normal ADO.NET Best practices

Offers: SQLiteConnectionSQLiteCommand - all Methods except “Xml”SQLiteDataAdapterSQLiteCommandBuilderSupports NTFS compression of Database File

Page 6: SQLite and the.NET Framework This PPT: Http:

SQLite 3.0 ODBC Driver

Http://www.ch-werner.de/sqliteodbc/html/ This is an experimental open source ODBC driver for the

wonderful SQLite 2.8.* and SQLite 3.* (alpha) Database Engine/Library. So far it is more a proof of concept and might contain lots of memory leaks and all other kinds of bugs. Thus I highly appreciate feedback.

WIN32 binaries (the ODBC driver DLL, install/uninstall programs) are in http://www.ch-werner.de/sqliteodbc/sqliteodbc-win32.zip

It works! It is SLOOOOW!

Page 7: SQLite and the.NET Framework This PPT: Http:

SQLite in Action: A First Look

private void CreateDatabase() {SQLiteConnection Conn = new SQLiteConnection(); string strPath=Server.MapPath("blog.db");Conn.ConnectionString = "Data Source="+strPath+";

Compress=False;Synchronous=Off;New=True;Version=3";Conn.Open();SQLiteCommand Cmd = new SQLiteCommand();Cmd = Conn.CreateCommand();Cmd.CommandText="CREATE TABLE BlogItems

(Blogid integer primary key , title varchar(250), link varchar(300), [description] varchar(8000), pubDate datetime, guid varchar(128), [public] integer )";

Cmd.ExecuteNonQuery(); . . . .

Page 8: SQLite and the.NET Framework This PPT: Http:

Important Scenarios Mobile Code

Device-hosted applicationsDatabase runs 100% on Device“Zero configuration” installationNO Client License Fees

Server / Desktop CodeAlternative to MSDE, MSAccess, MySqlNo installation RequiredFast database engineMultiThreaded

Page 9: SQLite and the.NET Framework This PPT: Http:

Mobile Code Scenario Advantages of mobile code database

Executes locally for performance and rich features

Can use a WebService to receive “GetChanges” DataSets to update database on server

No dependency on “what kind” of database is used on the server.

No complicated Server configuration No Client license fees to use SQLite

Page 10: SQLite and the.NET Framework This PPT: Http:

Demos!

Page 11: SQLite and the.NET Framework This PPT: Http:

URLS - Articles and Sample URLS - Articles and Sample Code!Code!• ASP.NET CacheDependency:ASP.NET CacheDependency:

http://www.eggheadcafe.com/articles/20040916.asphttp://www.eggheadcafe.com/articles/20040916.asp• SQLite DB and SQLiteBlog:SQLite DB and SQLiteBlog:• http://www.eggheadcafe.com/articles/20040714.asphttp://www.eggheadcafe.com/articles/20040714.asp• .Net Forum Control with SQLite: .Net Forum Control with SQLite:

http://www.eggheadcafe.com/articles/20041009.asphttp://www.eggheadcafe.com/articles/20041009.asp• SQLite Compact Framework: SQLite Compact Framework:

http://www.eggheadcafe.com/articles/sqlitecf3.ziphttp://www.eggheadcafe.com/articles/sqlitecf3.zip