diff options
author | Daniel Morgan <monodanmorg@yahoo.com> | 2003-01-19 20:39:25 +0300 |
---|---|---|
committer | Daniel Morgan <monodanmorg@yahoo.com> | 2003-01-19 20:39:25 +0300 |
commit | c40860f8f6073bf2e89beb08857b7e5b1cfb39bc (patch) | |
tree | 9d055e3f00ce5a41a7ddb1afcea68412a652c2ca /web/sqlite | |
parent | f8369d1fa5c907ad65e716fb8fec6cfca9221d57 (diff) |
2003-01-19 Daniel Morgan <danmorg@sc.rr.com>
* doc/ibmdb2: added file which is new web page
about IBM DB2 data provider at Mono.Data.DB2Client
* makefile
* commands: added ibmdb2 web page to go-mono web site
* doc/ado-net: added a couple more developers email, plus made the
email spam resistant, added Mono's DB2 data provider to list,
added more info about the ProviderFactory and retrieving data using
ADO.NET from ASP.NET, add notes about testing, misc cleanup
* doc/mysql
* doc/postgresql
* doc/sqlclient
* doc/oracle
* doc/tdsclient
* doc/firebird
* doc/oledb
* doc/odbc
* doc/sybase
* doc/sqlite: added testing notes and C# examples
* doc/gtk-sharp: added links for GTK# for Windows
svn path=/trunk/mono/; revision=10712
Diffstat (limited to 'web/sqlite')
-rwxr-xr-x | web/sqlite | 102 |
1 files changed, 93 insertions, 9 deletions
diff --git a/web/sqlite b/web/sqlite index 07312db51b6..85b35c997aa 100755 --- a/web/sqlite +++ b/web/sqlite @@ -1,28 +1,112 @@ * SQL Lite Data Provider <ul> - <li>Exists in namespace and assembly Mono.Data.SqliteClient + <li>Exists in namespace and assembly Mono.Data.SqliteClient</li> - <li>Created by Vladimir Vukicevic + <li>Created by Vladimir Vukicevic</li> <li><a href"http://www.hwaci.com/sw/sqlite/download.html">SQL Lite</a> binaries exist for Linux and Windows. sqlite.dll on Windows - and sqlite.so on Linux. + and sqlite.so on Linux.</li> </ul> -* Current Status +** Current Status <ul> - <li>Able to connect, execute commands, and retrieve data... + <li>Able to connect, execute commands, and retrieve data...</li> - <li>Works in mPhoto + <li>Works in mPhoto by providing access to a SQL Lite database to store images.</li> </ul> -* Action Plan +** Action Plan <ul> <li>Create a DataAdapter for SQL Lite named SqliteDataAdapter that can be used to - Fill a DataTable in a DataSet + Fill a DataTable in a DataSet</li> - <li>TODO + <li>Get the method GetSchemaTable() in class SqliteDataReader to return a DataTable + that works</li> </ul> + +** Testing + +<ul> + <li>Have a working mcs and mono</li> + <li>Make sure Mono.Data.SqliteClient.dll was built and is installed + in the same place as the mono class libraries.</li> + <li>If you do not have <a href"http://www.hwaci.com/sw/sqlite/download.html">SQL Lite</a>, + download it. There are binaries for Windows and Linux.</li> + <li>There is a test named SqliteTest.cs found at mcs/class/Mono.Data.SqliteTest/Test</li> + <li>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.</li> + <li>C# Example: +<pre> + using System; + using System.Data; + using Mono.Data.SqliteClient; + + public class Test + { + public static void Main(string[] args) + { + string connectionString = "URI=file:SqliteTest.db"; + IDbConnection dbcon; + dbcon = new MySQLConnection(connectionString); + IDbCommand dbcmd = dbcon.CreateCommand(); + // requires a table to be created named employee + // with columns firstname and lastname + // such as, + // CREATE TABLE employee ( + // firstname varchar(32), + // lastname varchar(32)); + string sql = + "SELECT firstname, lastname " + + "FROM employee"; + dbcmd.ConnectionString = sql; + IDataReader reader = dbcmd.ExecuteReader(); + while(reader.Read()) { + string FirstName = reader[0]; + string LastName = reader[1]; + Console.WriteLine("Name: " + + FirstName + " " + LastName); + } + // clean up + reader.Close(); + reader = null; + dbcmd.Dispose(); + dbcmd = null; + dbcon.Close(); + dbcon = null; + } + } +</pre> + </li> + <li>Building C# Example: + <ul> + <li>Save the example to a file, such as, TestExample.cs</li> + <li>Build on Linux: +<pre> + mcs TestExample.cs -r System.Data.dll \ + -r Mono.Data.SqliteClient.dll +</pre> + </li> + <li>Build on Windows via Cygwin: +<pre> + mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \ + TestExample.cs \ + -lib:C:/cygwin/home/MyHome/mono/install/lib \ + -r System.Data.dll \ + -r Mono.Data.SqliteClient.dll +</pre> + </li> + </ul> + </li> + <li>Running the Example: +<pre> +mono TestExample.exe +</pre> + </li> + +</ul> + |