X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=web%2Fodbc;h=80143fcb7eb92bdda8e45dec4acab847a06bd097;hb=a358cc9a43956e3b5c2a9ac345230fb7a6be377e;hp=33d25c9819372c4b8b7693d268e7a1f7fce35f4d;hpb=c40860f8f6073bf2e89beb08857b7e5b1cfb39bc;p=mono.git
diff --git a/web/odbc b/web/odbc
index 33d25c98193..80143fcb7eb 100755
--- a/web/odbc
+++ b/web/odbc
@@ -1,10 +1,15 @@
* ODBC Data Provider
+
- - Exists in namespace System.Data.Odbc and assembly System.Data
+
+
- ADO.NET Data Provider for Data Sources
+ that have ODBC support.
+
+ - Exists in namespace System.Data.Odbc and assembly System.Data
- - Works on Windows and Linux. Should have no problems working on UNIX too.
+
- Works on Windows and Linux. Should have no problems working on UNIX too.
- - Works on Windows via the native Windows odbc32.dll
+
- Works on Windows via the native Windows odbc32.dll
- Works on Linux via:
@@ -14,31 +19,33 @@
from Easysoft
- iODBC which has
- a commercial support
+ commercial support
from OpenLink Software
List of unixODBC drivers
- List of ODBC Vendors
+ List of ODBC Vendors
ODBC can connect to various databases which has an ODBC driver installed:
ODBC Provider created by Brian Ritchie.
Does not support trusted connections
+
** Current Status
@@ -70,6 +77,16 @@
Can get a DataTable containing schema info via GetSchemaTable() in a OdbcDataReader
Can Fill a DataTable in a DataSet via an OdbcDataAdapter
+
+ Works in SQL#, but Column names don't show up correctly.
+
+ 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.
+
+
** Action Plan
@@ -81,22 +98,47 @@
Testing with other setups
-** Testing ODBC provider
+** Testing ODBC provider with IBM DB2 Universal Database
-Test Mono's ODBC provider System.Data.Odbc with the MySQL ODBC driver MyODBC
+
+ - You need a working mono and mcs
+
+ - For Unix, you will need unixODBC or iODBC installed
+
+ - Have acess to a IBM DB2 Universal Database or
+ you can download from IBM
+
+ - Read these web pages about Unix, ODBC, and IBM DB2
+
+
+
+
+ - The ODBC provider is similar to the IBM DB2 provider.
+
+
+** Testing ODBC provider with MySQL
+You can test Mono's ODBC provider System.Data.Odbc with the MySQL ODBC driver MyODBC
+
- Take a look at OdbcTest.cs in mcs/class/System.Data/Test
- Here is a ConnectionString format if you have a DSN setup:
-"DSN=dataSetName;UID=username;PWD=password"
+"DSN=dataSetName;UID=myuserid;PWD=mypassword"
- - Here is a ConnectionString format if you do not have DSN (have not
- gotten this to work):
+
- Here is a ConnectionString format if you do not have a DSN (have not
+ gotten this to work though):
-"DRIVER={SQL Server};SERVER=(local);UID=sa;PWD=;DATABASE=pubs"
+"DRIVER={MySQL ODBC 3.51 Driver};" +
+"SERVER=localhost;DATABASE=test;" +
+"UID=myuserid;PASSWORD=mypassword;" +
+"OPTION=3";
+
- C# Example:
@@ -115,9 +157,10 @@
// 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
@@ -129,11 +172,11 @@
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);
}