X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=web%2Fado-net;h=0095d79ef79996374030641fce45c5c8a01272ac;hb=80496539cbb4d78d3cdd2806fe45a75d956f53a4;hp=852c94adbeb623870d766bf9fbdf283810f938fa;hpb=5f70f7b839a0db01690cc119fdfd25a9daa47434;p=mono.git diff --git a/web/ado-net b/web/ado-net index 852c94adbeb..0095d79ef79 100644 --- a/web/ado-net +++ b/web/ado-net @@ -1,229 +1,198 @@ * ADO.NET - The coordinator for the ADO.NET implementation is Rodrigo Moya, with - the collaboration of Daniel - Morgan and Tim Coleman. +** Data Access in Mono + +
On Unix systems: System.Data.OleDb uses the - LibGDA - engine. - -
LibGDA is a data access engine like ADO/OLE-DB, but for Unix. The - GDA in libGDA stands for GNU/GNOME Data Access, but it does not require GNOME. - It only requires glib2 and libxml2. LibGDA is used by - libgnomedb, GNOME-DB, and gaSQL. - -
There is work under way to get libgda working under - Windows using Cygwin by the GNOME-DB developers. - -
LibGDA has providers for MySQL, PostgreSQL, XML, ODBC (via unixODBC), - Oracle, Interbase, Sybase and MS SQL Server (via FreeTDS), IBM DB2, - SQLite and MS Access (via MDB Tools). - - * On Windows systems: System.Data.OleDb will use libgda as well, - if we can get it working, or OLE-DB as - its engine. - -
System.Data.SqlClient will then become a - provider for Microsoft SQL Server, both on Windows and - Linux, to be compatible with applications written - for the Microsoft .NET Development Framework. - -
Once Step 1 has been completed and the PostgreSQL - provider support has been moved to its own place at - Mono.Data.PostgreSQL, we will use - FreeTDS as the basis - for providing access to Microsoft SQL Server databases. Or we will - use FreeTDS and jTDS (a 100% Java JDBC Provider for TDS) as a basis for - creating a pure managed SQL Server provider. - -
FreeTDS is a C API for Unix and Windows that implements - the TDS (Tabular Data Stream) protocol used in accessing - Microsoft SQL Server and Sybase databases. A .NET Data Provider could be - created for Sybase databases as well, but this would be put in Mono.Data.Sybase. -
unixODBC works on Unix and Windows. Well, I have not actually - used it on Cygwin, but it does build and install without problems. - -
unixODBC has providers for: - Oracle, Microsoft SQL Server and Sybase (via FreeTDS), - MySQL, PostgreSQL, Informix, IBM DB2 Universal Database, - Interbase, miniSQL (mSQL), AdabasD, Empress, and others. - -
The idea in Microsoft .NET System.Data is to have - a managed provider for each supported DBMS. System.Data.SqlClient - for Microsoft SQL Server. - System.Data.OracleClient for Oracle 8i and 9i. - -
We will need to have Mono.Data.MySQL, Mono.Data.PostgreSQL, - Mono.Data.DB2, and Mono.Data.miniSQL. Others, - of course, are welcomed. - -
System.Data has been designed so - non-database providers can be created too. -
We are working on Steps 1, 2, 4, and 5. We still have tons and tons of - stuff still to do. If you have any ideas, let us know on the mono-list@ximian.com +
For Step 1, the PostgreSQL provider can connect, execute commands, retrieve - data via a Data Reader, read data in a DataTable in a DataSet via a Data Adapter, - and use input parameters in its SQL. - -
For Step 2, Rodrigo Moya has been working on System.Data.OleDb which uses libgda - which is an OLE-DB/ADO data access for Unix. The C-Sharp bindings to libgda - currently work - meaning they can compile, run, and you can connect to a - PostgreSQL database via libgda via the C-Sharp bindings to libgda. Basic - functionality (execution of commands, data retrieval, transactions, etc) are - now working. Current focus is on filling up the missing pieces (Data adapters - mainly). +** ADO.NET Data Providers -
For Step 3, we need someone to start on the Microsoft SQL Server and Sybase - support. This can be done by creating a FreeTDS .NET Data Provider - or C# bindings to FreeTDS native libraries. A better solution, but a solution - that would take longer, would be to create a pure - managed provider in C# that implements the TDS (Tabular DataStream) protocol. TDS - is used to access Microsoft SQL Server and Sybase databases. Another possibility - is to wrap System.Data.SqlClient around System.Data.OleDb since System.Data.OleDb on - Mono uses libgda and libgda has - a FreeTDS provider. Yet another possibility, port - the jTDS provider to a pure C# ADO.NET - provider. jTDS is a 100% pure Java (Type 4) open source JDBC 2.0 driver for - the Microsoft SQL Server series (6.5, 7.x and 2000). - -
For Step 4, Brian Ritchie has contributed an initial implementation of - an ODBC ADO.NET Provider that uses unixODBC. He has a basic implementations of - OdbcConnection, OdbcCommand, OdbcDataReader, OdbcParameter, and - OdbcParameterCollection. It can execute queries and display result sets - (and ExecuteNonQuery too). I'm currently working on the Parameter & - Transaction support. He has been doing his development on Debian against a DB2 - 7.2 UDB. - -
For Step 5, we have just begun creating a Mono.Data .NET Provider - a MySQL - .NET Provider that uses the MySQL C Client Library. This provider is - found in Mono.Data.MySql. We can currently connect, execute simple commands, and - retrieve results using a data reader. The shared client libraries - between windows version and linux are different: windows has libmySQL.dll - while linux has libmysqlclient.so. I have put this mapping in mono/config.in so it can - automatically be maped. There is a problem with mysql thread functions because - they do not load for some reasons when running under Mono. - The C# Bindings to MySQL are thanks to Brad Meril. - -
DataSet, DataAdaptor, DataTable, DataRelation, etc. need to be implemented - more. - -
Integration with ASP.NET needs to be started, such as, data binding - to a System.Web.UI.WebControls.DataGrid. This may involve implementing many classes - in System.Web and System.Data. Gonzalo, Gaurav, Leen, Patrik, Duncan, and others are - working very hard on the ASP.NET support. If you want to help, - contact Gonzalo Paniagua Javier - -
Integration with Windows.Forms, such as, data binding - to a System.Windows.Forms.DataGrid. This may involve implementing many classes - in System.Windows.Forms and System.Data. - -
Integration with GTK#, such as, data binding - to a GtkTreeView. This may involve creating new classes - to go between the glist data model and the ADO.NET data model. - -
Integration with QT#. Any information on how this can be done is appreciated. - -
Integration with GDA# and Libgnomedb# which exists in GTK#. Creating classes - to bind data between the data model in ADO.NET and the data model that - exists in GDA and - libgnomedb. There are some nifty widgets - (GUI controls) that can be used, such as, GnomeDbGrid, GnomeDbBrowswer, GnomeDbSqlEditor, - GnomeDbList, GnomeDbLogin, GnomeDbReportEditor, GnomeDbTableEditor, - GnomeDbCombo, and GnomeDbForm. - -
XML support in System.Data needs to be started. This involves working on - the classes: DataSet, XmlDataDocument, and the method ExecuteXmlReader() that - exists in a provider's class that implements IDbCommand. +
Mono has many ADO.NET Data Providers to get you connected: + +
External Projects that have created ADO.NET Providers that work on Mono: + +
Some tools that can be used for ADO.NET and other technologies (ASP.NET, XML, etc). + +
An ADO.NET Provider Factory + was created by Brian Ritchie. The + Provider Factory is a way to dynamically create + connections, commands, parameters, and data adapters based on configuration + information. -
The System.Data.dll gets built with the rest of the class library. - To compile the System.Data.dll assembly separately, you need: - - On Unix - +** Database Access from ASP.NET
- cd mcs/class/System.Data+
- mcs --target library -o System.Data.dll @list -
- cd mcs/class/System.Data - ../../nant/NAnt.exe -+** Testing + +
Name | +Assembly / Namespace | +Test | +
Microsoft SQL Server | +System.Data / System.Data.SqlClient | +SqlTest.cs at System.Data/Test | +
PostgreSQL (Npgsql) | +Npgsql / Npgsql | +*.cs at Npgsql/Test | +
Oracle (Mono) | +System.Data.OracleClient / System.Data.OracleClient | +TestOracleClient.cs at System.Data.OracleClient/Test | +
ODBC (Mono) | +System.Data.Odbc / System.Data | +OdbcTest.cs (to connect to MS SQL Server)at System.Data/Test | +
- cd mcs/class/System.Data - ../../nant/NAnt.exe clean --