SQLite-you can create and run it on. NET within 3 minutes.

Source: Internet
Author: User
Tags sqlite download

========================================================== ========================

This article is reprinted. You must ensure that this article is complete and the original author information and the link to this Article are fully retained.

E-mail:Khler@163.com

QQ: 23381103

MSN:Pragmac@hotmail.com

Site: http://www.infoq.com/cn/news/2008/01/sqlite-in-three-minutes

========================================================== ========================

 

 

SQLite is an open-source database and has become increasingly popular. It is very small and widely used in various types of applications.

What is SQLite?

The official website of SQLite defines SQLite as follows:

SQLite is a software database used to implement self-contained, non-service, zero-configuration, and transactional SQL database engines.
SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have an independent service process. SQLite reads and writes the original disk file directly. A complete SQL database with multiple tables, indexes, triggers, and views is included in an independent disk file. The database file format is cross-platform. You can connect between 32-bit and 64-bit systems, or even between big-Endian and little-Endian: this is two different byte sorting methods. Big-Endian means that the high byte in a word is placed at the low address in the word area of the memory, while little-Endian is opposite) the free copy of databases between two different architectures makes SQLite a popular choice for application file formats. SQLite cannot replace Oracle, but can be considered as an alternative to fopen.
SQLite is already the world's most widely deployed SQL database engine, used in countless desktop computer applications, as well as consumer electronics, such as mobile phones, handheld computers and MP3 players. The source code of SQLite is put in the public domain (that is, the public domain of Wikipedia.

SQLite was first applied on Linux and OSX platforms, but Windows applications with few database requirements have replaced SQL express and access databases. net.

There is an article from developer Mike Duncan that provides a guide for installing SQLite on. NET within 3 minutes. This guide is very useful. After reading it, you can use a lightweight database to process many tasks you threw to it.

3-minute Guide

The Guide starts from the first download of SQLite:

Although you can use the SQLite download page to obtain the Windows general library, I still intend to recommend that you obtain the SQLite ADO from SourceForge. NET 2.0 data provider. I am not saying that it is the most efficient version (it has an ADO packaging layer and the useless features included), but it is indeed a very easy-to-use version, it may be worth using for a long time.

Find the DLL:

Copy the found DLL (system. Data. SQLite. dll) to your project and add references.

Download and install an SQLite GUI tool. sqliteman has a very good Windows version. The guide says this:

The tool I 've been using is named "SQLite administrator" (a good name, it's free !) There is a "dessert"-There Is A interface similar to query analyzer. If you are interested, can you http://www.sqlite.org/cvstrac/wiki from here? P = managementtools find a large list of SQLite GUI clients.

The last step of the guide is to create an SQLite database:

Create a database using GUI and create a test table at will. A separate file with. s3db as the end is displayed.

Once system. Data. SQLite. dll is referenced as part of a. Net project, it can be used as easily as writing using system. Data. SQLite at the top of your application. By using the ADO. Net packaging layer, a parameterized query looks like this:

string lookupValue;
using (SQLiteCommand cmd = cnn.CreateCommand())
{
for (int i = 0; i < 100; i++)
{
lookupValue = getSomeLookupValue(i);
cmd.CommandText = @"UPDATE [Foo] SET [Value] = [Value] + 1
WHERE [Customer] LIKE '" + lookupValue + "'";
cmd.ExecuteNonQuery();

}
}
Data Provider

SQLite has actually influenced. NET development, and many data providers have been used in popular object-relational mapper frameworks.

  • SQLite Nhibernate provider
  • SQLite subsonic provider
  • SQLite LINQ provider

The LINQ provider allows. Net 3.5 developers to take advantage of the new LINQ framework and use SQLite as the backend data storage.

SQLite can be used as a good alternative to access or SQL express to quickly create and run database applications, and because databases can be used on both Linux and Mac OSX platforms, therefore, it is easy to create a database application that can be used across platforms.

View Original English text: Up and running with SQLite on. NET in 3 minutes

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.