4 <li> Provides a OleDb-like provider for Mono
5 using <a href="http://www.gnome-db.org/">GDA</a> as the data access layer.</li>
7 <li> Exists in namespace System.Data.OleDb and assembly System.Data</li>
9 <li>Created by Rodrigo Moya</li>
11 <li>LibGDA has providers for:</li>
13 <li><a href="http://www.mysql.com/">MySQL</a></li>
14 <li><a href="http://www.postgresql.org/">PostgreSQL</a></li>
16 <li>ODBC (via <a href="http://www.unixodbc.org/">unixODBC</a>)</li>
17 <li><a href="http://www.oracle.com/">Oracle</a></li>
18 <li><a href="http://www.borland.com/products/downloads/download_interbase.html">Interbase</a></li>
19 <li><a href="http://www.sybase.com/downloads">Sybase</a> and
20 <a href="http://www.microsoft.com/sql/default.asp">Microsoft SQL Server</a> (
21 via <a href="http://www.freetds.org/">FreeTDS</a>)</li>
22 <li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a></li>
23 <li><a href="http://www.hwaci.com/sw/sqlite/download.html">SQL Lite</a></li>
24 <li><a href="http://www.microsoft.com/office/access/default.asp">MS Access</a></li>
25 (via <a href="http://mdbtools.sourceforge.net/">MDB Tools</a>)</li>
29 <li>Does not support trusted connections</li>
34 <li>The OleDb provider is working with libgda (an OLE-DB/ADO data access for Unix).
35 The C-Sharp bindings to libgda currently work - meaning they can compile, run,
36 and you can connect to a
37 PostgreSQL database via libgda via the C-Sharp bindings to libgda.</li>
40 functionality (execution of commands, data retrieval, transactions, etc) are
43 <li>An inital implementation of GetSchemaTable() for
44 the OleDbDataReader has been checked into cvs. GetSchemaTable() isn't correct for OleDb,
45 but the foundation is there.</li>
50 <li>Current focus is on filling up the missing pieces (Data adapters
51 mainly) and schema support.</li>
53 <li>We need help building libgda on Windows though. libgda
54 builds find on linux though.</li>
56 <li>Need to make the OleDb provider compatible with the OleDb provider in Microsoft .NET</li>
59 ** Testing OleDb with libgda's PostgreSQL provider
62 <li>Requires a working mono and mcs</li>
63 <li>Requires Linux because the OleDb provider uses libgda and libgda only
65 <li>Connection String format: "Provider=providerName;...". providerName is the
66 name of the Provider you use, such as, PostgreSQL, MySQL, etc. The elipsis ...
67 means that the connection parameters are dependent upon the provider being used and
68 are passed to libgda for connecting. Such paramters, can be: Database, User ID, Password,
70 <li>See the test TestOleDb.cs found at mcs/class/System.Data/System.Data.OleDb</li>
71 <li>C# Example for Mono's System.Data.OleDb:
75 using System.Data.OleDb;
79 public static void Main(string[] args)
81 // there is a libgda PostgreSQL provider
82 string connectionString =
83 "Provider=PostgreSQL;" +
87 dbcon = new OleDbConnection(connectionString);
88 IDbCommand dbcmd = dbcon.CreateCommand();
89 // requires a table to be created named employee
90 // with columns firstname and lastname
92 // CREATE TABLE employee (
93 // firstname varchar(32),
94 // lastname varchar(32));
96 "SELECT firstname, lastname " +
98 dbcmd.ConnectionString = sql;
99 IDataReader reader = dbcmd.ExecuteReader();
100 while(reader.Read()) {
101 string FirstName = reader["firstname"];
102 string LastName = reader["lastname"];
103 Console.WriteLine("Name: " +
104 FirstName + " " + LastName);
117 <li>Building C# Example:
119 <li>Save the example to a file, such as, TestExample.cs</li>
122 mcs TestExample.cs -r System.Data.dll
125 <li>Build on Windows via Cygwin:
127 mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
129 -lib:C:/cygwin/home/MyHome/mono/install/lib \
135 <li>Running the Example: