X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=doc%2Fsqlite;h=35ee305689659cee39c9f51f5ddf9947ac02c723;hb=c25d8405e22b09f3a1927a3b5b63b9e7d5629eb4;hp=85b35c997aa708f627ba4615c9fcef169fd425c0;hpb=c40860f8f6073bf2e89beb08857b7e5b1cfb39bc;p=mono.git
diff --git a/doc/sqlite b/doc/sqlite
index 85b35c997aa..35ee3056896 100755
--- a/doc/sqlite
+++ b/doc/sqlite
@@ -1,13 +1,38 @@
* SQL Lite Data Provider
+ - ADO.NET Data Provider for
+ the SQL Lite which
+ is an embeddable SQL database engine
+
+ - From the SQL Lite web page: SQLite is a C library that
+ implements an embeddable SQL database engine. Programs that link with
+ the SQLite library can have SQL database access without
+ running a separate RDBMS process. The distribution
+ comes with a standalone command-line access program (sqlite) that
+ can be used to administer an SQLite database and which serves
+ as an example of how to use the SQLite library. SQLite is not a client library
+ used to connect to a big database server. SQLite is the server. The SQLite
+ library reads and writes directly to and from the database files on disk.
+
+ - SQL Lite can be downloaded
+ from here.
+ binaries exist for Linux and Windows. sqlite.dll on Windows
+ and sqlite.so on Linux. The source code is available too.
+
- Exists in namespace and assembly Mono.Data.SqliteClient
- - Created by Vladimir Vukicevic
-
- - SQL Lite
- binaries exist for Linux and Windows. sqlite.dll on Windows
- and sqlite.so on Linux.
+ - Created by Vladimir Vukicevic so he could have a database of
+ thumbnail images for mPhoto. mPhoto is GUI application
+ for cataloging images. mPhoto runs on Mono
+ and uses GTK# for its GUI.
+
+ - Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla here. If you
+ do not have Bugzilla user account, it is free
+ and easy to
+ create one here.
+
** Current Status
@@ -32,14 +57,19 @@
- Have a working mcs and mono
+
- Make sure Mono.Data.SqliteClient.dll was built and is installed
in the same place as the mono class libraries.
+
- If you do not have SQL Lite,
download it. There are binaries for Windows and Linux.
+
- There is a test named SqliteTest.cs found at mcs/class/Mono.Data.SqliteTest/Test
+
- Has a connection string format of "URI=file:some/path". For example,
the connection string "URI=file:SqliteTest.db" will use the database file
named SqliteTest.db, if it does not exist, the file will be created.
+
- C# Example:
using System;
@@ -53,6 +83,7 @@
string connectionString = "URI=file:SqliteTest.db";
IDbConnection dbcon;
dbcon = new MySQLConnection(connectionString);
+ dbcon.Open();
IDbCommand dbcmd = dbcon.CreateCommand();
// requires a table to be created named employee
// with columns firstname and lastname
@@ -63,11 +94,11 @@
string sql =
"SELECT firstname, lastname " +
"FROM employee";
- dbcmd.ConnectionString = sql;
+ dbcmd.CommandText = sql;
IDataReader reader = dbcmd.ExecuteReader();
while(reader.Read()) {
- string FirstName = reader[0];
- string LastName = reader[1];
+ string FirstName = (string) reader[0];
+ string LastName = (string) reader[1];
Console.WriteLine("Name: " +
FirstName + " " + LastName);
}