* ODBC Data Provider
+
<ul>
- <li>Exists in namespace System.Data.Odbc and assembly System.Data
+
+ <li>ADO.NET Data Provider for Data Sources
+ that have <a href="http://www.microsoft.com/data/odbc/">ODBC</a> support.</li>
+
+ <li>Exists in namespace System.Data.Odbc and assembly System.Data</li>
- <li>Works on Windows and Linux. Should have no problems working on UNIX too.
+ <li>Works on Windows and Linux. Should have no problems working on UNIX too.</li>
- <li>Works on Windows via the native Windows odbc32.dll
+ <li>Works on Windows via the native Windows odbc32.dll</li>
<li>Works on Linux via:
from <a href="http://www.easysoft.com/">Easysoft</a></li>
<li><a href="http://www.iodbc.org/">iODBC</a> which has
- a commercial support
+ commercial support
from <a href="http://oplweb.openlinksw.com:8080/download/">OpenLink Software</a></li>
</ul>
<li>List of unixODBC <a href="http://www.unixodbc.org/drivers.html">drivers</a>
- <li>List of <a href="http://ourworld.compuserve.com/homepages/Ken_North/odbcvend.htm">ODBC Vendors</a>
+ <li>List of <a href="http://www.sqlsummit.com/odbcvend.htm">ODBC Vendors</a>
<li>ODBC can connect to various databases which has an ODBC driver installed:
<ul>
- <li><a href="http://www.mysql.com/">MySQL</a>
- <li><a href="http://www.postgresql.org/">PostgreSQL</a>
- <li><a href="http://www.oracle.com/">Oracle</a>
- <li><a href="http://www.borland.com/products/downloads/download_interbase.html">Interbase</a>
- <li><a href="http://www.sybase.com/downloads">Sybase</a> and
+ <li><a href="http://www.mysql.com/">MySQL</a></li>
+ <li><a href="http://www.postgresql.org/">PostgreSQL</a></li>
+ <li><a href="http://www.oracle.com/">Oracle</a></li>
+ <li><a href="http://www.borland.com/products/downloads/download_interbase.html">Interbase</a></li>
+ <li><a href="http://www.sybase.com/downloads">Sybase</a> (
+ via <a href="http://www.freetds.org/">FreeTDS</a> on UNIX)</li>
<li><a href="http://www.microsoft.com/sql/default.asp">Microsoft SQL Server</a> (
- via <a href="http://www.freetds.org/">FreeTDS</a> on UNIX)
- <li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a>
- <li><a href="http://www.microsoft.com/office/access/default.asp">MS Access</a>
- (via <a href="http://mdbtools.sourceforge.net/">MDB Tools</a> on UNIX)
+ via <a href="http://www.freetds.org/">FreeTDS</a> on UNIX)</li>
+ <li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a></li>
+ <li><a href="http://www.microsoft.com/office/access">MS Access</a>
+ (via <a href="http://mdbtools.sourceforge.net/">MDB Tools</a> on UNIX)</li>
</ul>
<li>ODBC Provider created by Brian Ritchie.</li>
<li>Does not support trusted connections</li>
+
</ul>
** Current Status
<li>Can get a DataTable containing schema info via GetSchemaTable() in a OdbcDataReader</li>
<li>Can Fill a DataTable in a DataSet via an OdbcDataAdapter</li>
+
+ <li>Works in SQL#, but Column names don't show up correctly.</li>
+
+ <li>Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have Bugzilla user account, it is free
+ and easy to
+ create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+
</ul>
** Action Plan
<li>Testing with other setups
</ul>
-** Testing ODBC provider
+** Testing ODBC provider with IBM DB2 Universal Database
-<p>Test Mono's ODBC provider System.Data.Odbc with the MySQL ODBC driver MyODBC
+<ul>
+ <li>You need a working mono and mcs</li>
+
+ <li>For Unix, you will need unixODBC or iODBC installed</li>
+
+ <li>Have acess to a <a href="http://www-306.ibm.com/software/data/db2/">IBM DB2 Universal Database</a> or
+ you can download from IBM</li>
+
+ <li>Read these web pages about Unix, ODBC, and IBM DB2
+
+ <ul>
+ <li><a href="http://www.unixodbc.com/doc/db2.html">unixODBC web page about IBM DB2</a></li>
+ <li><a href="http://www-306.ibm.com/software/data/db2/udb/ad/v8/cli/t0010406.htm">IBM web page about unixODBC and DB2</a></li>
+ </ul>
+ </li>
+
+ <li>The ODBC provider is similar to the <a href="http://www.go-mono.com/ibmdb2.html">IBM DB2</a> provider.</li>
+</ul>
+
+** Testing ODBC provider with MySQL
+<p>You can test Mono's ODBC provider System.Data.Odbc with the MySQL ODBC driver MyODBC
+
<p><ul>
<li>Take a look at OdbcTest.cs in mcs/class/System.Data/Test</li>
<li>Here is a ConnectionString format if you have a DSN setup:
<pre>
-"DSN=dataSetName;UID=username;PWD=password"
+"DSN=dataSetName;UID=myuserid;PWD=mypassword"
</pre>
</li>
- <li>Here is a ConnectionString format if you do not have DSN (have not
- gotten this to work):
+ <li>Here is a ConnectionString format if you do not have a DSN (have not
+ gotten this to work though):
<pre>
-"DRIVER={SQL Server};SERVER=(local);UID=sa;PWD=;DATABASE=pubs"
+"DRIVER={MySQL ODBC 3.51 Driver};" +\r
+"SERVER=localhost;DATABASE=test;" +\r
+"UID=myuserid;PASSWORD=mypassword;" +\r
+"OPTION=3";\r
+
</pre>
</li>
<li>C# Example:
// hostname of localhost and database test
string connectionString =
"DSN=MYSQLDSN;" +
- "UID=mysql;" +
- "PWD=;";
+ "UID=myuserid;" +
+ "PWD=mypassword";
IDbConnection dbcon;
+ dbcon.Open();
dbcon = new OdbcConnection(connectionString);
IDbCommand dbcmd = dbcon.CreateCommand();
// requires a table to be created named employee
string sql =
"SELECT firstname, lastname " +
"FROM employee";
- dbcmd.ConnectionString = sql;
+ dbcmd.CommandText = sql;
IDataReader reader = dbcmd.ExecuteReader();
while(reader.Read()) {
- string FirstName = reader["firstname"];
- string LastName = reader["lastname"];
+ string FirstName = (string) reader["firstname"];
+ string LastName = (string) reader["lastname"];
Console.WriteLine("Name: " +
FirstName + " " + LastName);
}