Implement G_STRLOC
[mono.git] / web / ado-net
index 6eced795105fd3631af4061c4d5bb94ea10f2695..0095d79ef79996374030641fce45c5c8a01272ac 100644 (file)
 * ADO.NET
 
-       The coordinator for the ADO.NET implementation is 
-       <a href="mailto:rodrigo@ximian.com">Rodrigo Moya</a>, 
-       with the collaboration of: 
-       <a href="mailto:danmorg@sc.rr.com">Daniel Morgan</a>, 
-       <a href="mailto:tim@timcoleman.com">Tim Coleman</a>,
-       <a href="mailto:brianlritchie@hotmail.com">Brian Ritchie</a>, and
-       <a href="mailto:vladimir@pobox.com">Vladimir Vukicevic</a>.
+** Data Access in Mono
+
+<ul>
+       <li>Today, our goal is to be compatible with  .NET 1.1 and .NET 1.0.  We also would like
+   to extend data access beyond what is included with .NET 1.0 and .NET 1.1,
+   such as, include access to more databases, such as, PostgreSQL and MySQL,
+   but also provide classes that help in creating data source-agnostic code, such as, 
+   Mono.Data.ProviderFactory.</li>
+   
+   <li>In the future, we would like to be compatible with .NET 1.2. This includes features 
+   like <a href="http://longhorn.msdn.microsoft.com/lhsdk/ndp/daconworkingwithobjectspacesarchitecture.aspx">ObjectSpaces</a></li>
        
+</ul>
 
-* Action plan
-
-       <p>The current plan to implement ADO.NET is as follows:
+** Bugs and Feature Requests
 
-       <ul>
-               <li>Either create ADO.NET providers or modify pre-exiting ADO.NET providers to
-               work with Mono
-               
-               <ul>
-                       <li>Create ADO.NET Providers
-                       
-                       <ul>
-                                       <li><a href="http://www.go-mono.com/mysql.html">MySQL</a>
-                                       <li><a href="http://www.go-mono.com/odbc.html">ODBC</a>
-                                       <li><a href="http://www.go-mono.com/oledb.html">OLE DB</a>
-                                       <li><a href="http://www.go-mono.com/postgresql.html">PostgreSQL</a>
-                                       <li><a href="http://www.go-mono.com/sqlclient.html">Microsoft SQL Server</a>
-                                       <li><a href="http://www.go-mono.com/sqlite.html">SQL Lite</a>
-                                       <li><a href="http://www.go-mono.com/sybase.html">Sybase</a>
-                                       <li><a href="http://www.go-mono.com/tdsclient.html">TDS Generic</a>
-                                       <li>Providers which we do not have, but we would like to have.  Currently,
-                                       some of these databases are supported via the ODBC or OLEDB providers.
-                                       <ul>
-                                               <li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a>
-                                               <li>miniSQL
-                                               <li><a href="http://www.oracle.com/">Oracle</a> - could be done by creating C# bindings to OCI (Oracle C Call Level Interface)
-                                               <li>BerkeleyDB (Sleepycat)
-                                               <li><a href="http://www.sapdb.org/">SapDB</a>
-                                               <li>Microsoft Access - could be done by creating C# bindings to <a href="http://mdbtools.sourceforge.net">MDB Tools</a>
-                                               <li>dbase or xbase type database files
-                                               <li>Others, of course, are welcomed...
-                 
-                                       </ul>
-                               </ul>
-                               <br>
-                       <li>Modify Pre-existing ADO.NET Providers to work with Mono.  This may
-                       require fixing or implementing areas of Mono too.
-                               <ul>
-                                       <li><a href="http://www.go-mono.com/firebird.html">Firebird Interbase</a>
-                                       <li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a> a PostgreSQL provider
-                                       written in 100% C#
-                                       <li><a href="http://sourceforge.net/projects/mysqldrivercs/">MySQLDriverCS</a> is a MySQL provider written in C#
-                                       <li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a MySQL Manager provider written in C#
-                               </ul>
-               </ul>
-       <br>
-       <li>Create Tools for Configuration, Testing, and Entering SQL Queries  
-       <ul>
-               <li><b>SQL# CLI - a command-line tool</b> to execute SQL commands,
-                 test connection strings, and connect to various ADO.NET
-                 providers in Mono.  The SQL# CLI can be found in
-                 mcs/tools/SqlSharp/SqlSharpCli.cs
-                 It is written in C# and runs on Mono and .NET
+<ul>
 
-               <li><p><b>SQL# GUI - a GUI tool</b> to execute SQL commands. 
-                 Currently, there is SQL# For GTK# which
-                 can be found at 
-                 mcs/tools/SqlSharp/gui/gtk-sharp.  It has a SQL editor with 
-                 syntax hi lighting of SQL keywords
-          
-               <li><b>Configuration Command-Line and GUI Tools for ADO.NET</b>.  
-                 These tools have not been started.  The tools would be written in
-                 C# and run on Mono. The
-                 configuration tool can be used to do the following:
-                 <ul> 
-                       <li>setup DSNs for the ODBC and OLE-DB
-                               providers and configurations for 
-                               their underlying libraries (unixODBC and libgda)
-                   <li>setup configurations for the Mono.Data.ProviderFactory
-                               that Brian Ritchie created
-                   <li>setup native database client library configurations too, such as,
-                               freetds.conf for Microsoft SQL Server and Sybase
-                 </ul>
-               
-       </ul>
-</ul>
+       <li>Bugs with Mono or any data provider in Mono should be reported 
+           in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>.  If you
+           do not have a Bugzilla user account, it is free 
+           and easy to create 
+           one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
        
-* Current Status
+       <li>Any requests for new features or missing functionality
+           can entered as a bug in Bugzilla too</li>
 
-       <p>Variouls ADO.NET Providers have been created: PostgreSQL, MySQL, Sybase, SQL Lite,
-       Microsoft SQL Server, OLE DB, ODBC, and TDS Generic.  See their respective web page for
-       more information.
-               
-       <p><b>DataSet, DataAdaptor, DataTable, DataRelation, DataRow, DataColumn,
-       DataColumnCollection, DataRowCollection, and others</b> need more work.  There are
-       many classes that are just stubs and need to be implemented.  
-               
-       <p><b>Integration with ASP.NET</b> has not been 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 <a href="mailto:gonzalo@ximian.com">Gonzalo Paniagua Javier</a>
-       
-       <p><b>Integration with Windows.Forms</b> has not been started, such as, data binding 
-       to a System.Windows.Forms.DataGrid.  This may involve implementing many classes
-       in System.Windows.Forms and System.Data.
-       
-       <p><b>Integration with <a href="http://gtk-sharp.sourceforge.net/">GTK#</a></b> 
-       has not been started, 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.
-       Mike Kestner would be the best person to ask for help on GTK#.
-       
-       <p><b>Integration with QT#</b> has not been started.  Any information on 
-       how this can be done is appreciated.  Adam Treat would be the best 
-       person to ask about QT#.
-       
-       <p><b>Integration with GDA#</b> has not been started.  It is 
-       included in the GTK# project, GDA# 
-       does not require GTK+ nor GNOME.  GDA# is C# bindings 
-       to <a href="http://www.gnome-db.org/">GDA</a> which
-       is an ADO/OLE-DB like layer for Linux provided as a C library.  Classes
-       that would bind data between the ADO.NET data model and the GDA data model will
-       need to be created.  Rodrigo Moya is the best person to contact about this.
-       
-       <p><b>Integration with GnomeDb#</b> has not been started.  It is
-       included in the GTK# project and uses GDA# for its data access model.
-       Creating classes to bind data between the data model in ADO.NET 
-       and the data model that exists in GDA# and GnomeDb# will
-       need to be started.  GnomeDb# is C# bindings to
-       <a href="http://www.gnome-db.org/">GnomeDb</a> which uses 
-       <a href="http://www.gnome-db.org/">GDA</a> as its data access layer.  GnomeDb
-       is a C API in a library that contains
-       gtk+ widgets (GUI controls) for data access.  There are some nifty widgets
-       (GUI controls) that can be used, such as, GnomeDbGrid, GnomeDbBrowswer, 
-       GnomeDbSqlEditor, GnomeDbList, GnomeDbLogin, GnomeDbReportEditor, GnomeDbTableEditor, 
-       GnomeDbCombo, and GnomeDbForm.  Rodrigo Moya is the best person to contact.
-               
-       <p><b>XML support in System.Data</b> needs work.  This involves working on
-       the classes: DataSet, XmlDataDocument, and the method ExecuteXmlReader() that
-       exists in a provider's class that implements IDbCommand, and others.
-       Stuart Caborn has started the XML support in a DataSet.  Tim Coleman started
-       XML support in the ExecuteXmlReader() in a SqlCommand.
-       
-       <p><b>ADO.NET Provider Factory</b> has been started by Brian Ritchie.  The 
-       Provider Factory is used to dynamically create data provider
-       connections and data adapters based on configuration information.  This
-       provider factory can also provide utility functions needed by a lot of 
-       providers but are not exposed via the provider.
+</ul>
        
-       <p><b>ADO.NET Multiplexor Provider</b> needs to be created.  It can use the
-       ADO.NET Provider Factory to create its connections and adapters, but the
-       Multiplexor Provider is a Generic Provider that internally uses an existing
-       provider based on configuration options.  This is not
-       part of Microsoft .NET, but it needs to be able to run on Microsoft .NET
-       and Mono.  This provider can be a generic provider, much like the ODBC.NET and
-       OLEDB.NET providers are, but be written in 100% C# and be configurable via
-       a configuration file.  This provider will multiplex to other providers
-       that exist.  If one does not exist for a given DBMS, 
-       default to the ODBC or OLEDB .NET provider.  
+** ADO.NET Data Providers
        
-       <p>According to Gonzalo, this is how the configuration could be implemented for
-       the Provider Factory and Multiplexor Provider.
+<p>Mono has many ADO.NET Data Providers to get you connected:
+                       
+<ul>
+       <li><a href="http://www.go-mono.com/ibmdb2.html">IBM DB2 Universal Database</a></li>
+       <li><a href="http://www.go-mono.com/mysql.html">MySQL</a></li>
+       <li><a href="http://www.go-mono.com/odbc.html">ODBC</a></li>
+       <li><a href="http://www.go-mono.com/oracle.html">Oracle</a></li>
+       <li><a href="http://www.go-mono.com/oledb.html">OLE DB</a></li>
+       <li><a href="http://www.go-mono.com/postgresql.html">PostgreSQL</a></li>
+       <li><a href="http://www.go-mono.com/sqlclient.html">Microsoft SQL Server</a></li>
+       <li><a href="http://www.go-mono.com/sqlite.html">SQL Lite</a></li>
+       <li><a href="http://www.go-mono.com/sybase.html">Sybase</a></li>
+       <li><a href="http://www.go-mono.com/tdsclient.html">Older Microsoft SQL Server and Sybase databases</a></li>
+</ul>
 
-       <p>After some work done in System.Configuration, you can now do something
-    like:   
+<p>External Projects that have created ADO.NET Providers that work on Mono:
 
-       <p>
- <pre>
- // Get an instance of the multiplexor from machine.config file
- // Can be overriden in the application config file    
- object o = ConnectionSettings.GetConfig 
-               ("mono.data/multiplexor");
- if (o == null)
-       --- error
-    
- Multiplexor mp = (Multiplexor) o;
-    
- // may be a string [] argument can help passing arguments
- IDbConnection cnc = mp.CreateConnection (providerName);
-</pre>    
+<ul>
 
-       <p>and in the machine.config file:
+       <li><a href="http://www.go-mono.com/firebird.html">Firebird Interbase</a></li> is a
+          Firebird SQL Managed data provider. It can be used with Interbase databases too.  It
+          is written in 100%C# and does not require a client library. Works on .NET and Mono.</a>
+       <li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a> is a 
+          PostgreSQL Managed data provider written 
+          in 100% C#, does not require a client library, and works on .NET and Mono</li>
+       <li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a 
+          MySQL Managed data provider written in 100% C#, does not
+          require a client library, and works on .NET and Mono</li>
+</ul>
 
-<pre>
-  &lt;configuration&gt;
-   &lt;configSections&gt;
-    &lt;section name="mono.data"
-      type="Mono.Data.MultiplexorSectionHandler,Mono.Data"/&gt;
-    ....
-   &lt;/configSections>
-   ...
-   &lt;sectionGroup name="mono.data"&gt;
-     &lt;multiplexor&gt;
-       &lt;add provider="PostgreSQL" 
-          type="Mono.Data.PostgreSQLClient,Mono.Data"
-          validate="false" 
-          parameters="USER=xxx;HOST=127.0.0.1;DBNAME=xxx"/&gt;
-     &lt;/multiplexor&gt;
-   &lt;/sectionGroup&gt;
-  &lt;/configuration&gt;
-</pre>
+** Tools
 
-       <p>validate="false" tells MultiplexorSectionHandler not to load the Type
-       until an instance is required. You can add more attributes or whatever
-       inside <multiplexor> as long as MultiplexorSectionHandler parses it.
+<p>Some tools that can be used for ADO.NET and other technologies (ASP.NET, XML, etc).
 
-<pre>
-public class MultiplexorSectionHandler :
-IConfigurationSectionHandler
-{
-    public object Create (object parent, 
-      object configContext,
-      XmlNode section)
-    {
-       Multiplexor mp;
-       // Here you get the ChildNodes and 
-       // set up a Multiplexor
-       // instance that will hold the information 
-       // needed to create 
-       // instances of each provider. Only one 
-       // instance will be 
-       // created by the config system.
-            return mp;
-    }
- }
-</pre>
-       <p>This way, if our providers works with MS, the user can test them in both
-       MS and mono by just adding a few lines to machine.config (i still have
-       to upload a default machine.config file for mono). And this is the .NET
-       way of doing it (of course, if you prefer, you can use the other config
-       file. I just wanted to make people aware of this feature that now works
-       on mono).
-       
-       <p><b>Building System.Data</b>
-       
-       <p>The System.Data.dll gets built with the rest of the class library.
-       To compile the System.Data.dll assembly separately, you need:
+<ul>
+       <li>sqlsharp.exe
+               <ul>
+                       <li>SQL# is a command line query tool included with Mono to enter and execute SQL statements</li>
+               </ul>
+       </li>
+       <li>xsd.exe
+               <ul>
+                       <li>XML Schema Definition tool</li>
+                               <ul>
+                                       <li><b>XDR to XSD</b> - used to generate an XML schema from an XDR (XML Data Reduced schema) file. \r
+                                               XDR was used by Microsoft prior to XSD becoming a W3C recommendation.  So, this needs\r
+                                               to be supported for legacy reasons</li>\r
+                                       <li><b>XML to XSD</b> - used to generate an XML schema from an XML file</li> \r
+                                       <li><b>XSD to DataSet</b> - used to generate DataSet classes from an XSD schema file.  The\r
+                                               DataSet classes created can then be used with XML data</li>\r
+                                       <li><b>XSD to Classes</b> - used to generate classes from an XSD schema file. The \r
+                                               classes created can be used with System.XML.Serialization.XMLSerializer \r
+                                               to read and write XML code that follows the schema</li>\r
+                                       <li><b>Classes to XSD</b> - used to generate an XML schema \r
+                                               from type(s) in a assembly file. The \r
+                                               XML schema created by the tool defines the XML format used \r
+                                               by System.XML.Serialization.XMLSerializer</li>\r
+                               </ul>\r
+                       </li>\r
+               </ul>\r
+       </li>
+</ul>
 
-       <b>On Unix</b>
+** Extra Classes in Mono ADO.NET
 
+ <p>An ADO.NET <a href="http://www.go-mono.com/provider-factory.html">Provider Factory</a> 
+    was created by Brian Ritchie.  The 
+       Provider Factory is a way to dynamically create
+       connections, commands, parameters, and data adapters based on configuration 
+       information.
+       
+** Database Access from ASP.NET
        <ul>
-               * update your mono sources. Be sure you have latest mcs.exe
-                 and .dll's, since there have been many fixes needed for
-                 compilation on Linux.
-
-               * compile System.Data.dll:
-<pre>
- cd mcs/class/System.Data<br>
- mcs --target library -o \
-    System.Data.dll @list
-</pre>
+               <li>Take a look at xsp in cvs and look at the examples in test: dbpage1.aspx
+               and dbpage2.aspx:
+                       <ul>
+                               <li>Notice that the namespace System.Data is imported via <b>import</b></li>
+                               <li>A NameValueCollection is gotten using ConfigurationSettings.AppSetings. These
+                               settings are gotten from the file server.exe.config which is a XML file.   The XML
+                               file has a section appSettings.  In the appSettings section, you have keys 
+                               for DBProviderAssembly, DBConnectionType, and DBConnectionString.
+                               <ul>
+                                       <li><b>DBProviderAssembly</b> is the assembly of the ADO.NET provider.  
+                                             For example: 
+                                             "ByteFX.Data"</li>
+                                       <li><b>DBConnectionType</b> is the System.Type of the class that 
+                                             implements System.Data.IDbConnection that is found
+                                         in the DBProviderAssembly.  
+                                         For example: 
+                                         "ByteFX.Data.MySqlConnection"</li> 
+                                   <li><b>DBConnectionString</b> is the ConnectionString to set to the
+                                         IDbConnection object to use in opening a connection to a data source.
+                                         For Example: 
+                                         "hostaddr=127.0.0.1;user=monotest;password=monotest;dbname=monotest"</li>
+                               </ul>
+                               <li>The function GetConnectionData() gets the database provider assembly, connection type,
+                               and connection string parameters if they exist; otherwise, it uses default values.  This is
+                               done during the loading of the web page.</li>
+                               <li>With the connection parameters, the assembly is loaded, the connection type is verified that
+                               it implements IDbConnection and an instance of the class can be created, creates a instance
+                               of the class, sets the connection string, and opens the connection.</li>
+                       </ul>
+               </li>
        </ul>
 
-       <b>On Windows</b>
-
-       <ul>
-               * update your mono sources. Be sure you have latest mcs.exe
-                 and .dll's.  You can use the same method as Linux, 
-                 or you can use NAnt.
-
-               * To use NAnt:
-
-<pre>
- cd mcs/class/System.Data
- ../../nant/NAnt.exe
-</pre>
+** Testing
+
+<ul>
+       <li>Testing connection-oriented classes are done 
+       via the provider specific tests
+       found in the mcs source at mcs/class</br>
+               <table border=1>        
+                       <tr>
+                               <td><b>Name</b></td>
+                               <td><b>Assembly /</br> Namespace</b></td>
+                               <td><b>Test</b></td>    
+                       </tr>           
+                       
+                       <tr>
+                               <td>Microsoft</br> SQL</br> Server</br></td>
+                               <td>System.Data /</br> System.Data.SqlClient</td>
+                               <td>SqlTest.cs at</br> System.Data/Test</td>
+                       </tr>
+
+                       <tr>
+                               <td>PostgreSQL</br> (Npgsql)</td>
+                               <td>Npgsql /</br> Npgsql</td>
+                               <td>*.cs at</br> Npgsql/Test</td>
+                       </tr>
+
+                       <tr>
+                               <td>Oracle</br> (Mono)</td>
+                               <td>System.Data.OracleClient /</br> System.Data.OracleClient</td>
+                               <td>TestOracleClient.cs at</br> System.Data.OracleClient/Test</td>
+                       </tr>
+
+                       <tr>
+                               <td>ODBC</br> (Mono)</td>
+                               <td>System.Data.Odbc /</br> System.Data</td>
+                               <td>OdbcTest.cs (to connect to MS SQL Server)at</br> System.Data/Test</td>
+                       </tr>
                        
-               * This will automatically copy the System.Data.dll to Test.
-                 If you need to do a clean for the System.Data.dll assembly,<br><br>
+               </table>
+       
 
-<pre>
- cd mcs/class/System.Data
- ../../nant/NAnt.exe clean 
-</pre>
-       </ul>
+       <li><a href="http://www.go-mono.com/testing.html">Testing non-connection classes</a> are 
+       done via mono's modified version of NUnit.
+               <ul>
+                       <li>To run all the NUnit tests for Mono, you need the mcs source.  cd to the root
+                       of the mcs source.  To run it:
+                               <ul>
+                                       <li>make test</li>
+                               </ul>
+                       </li>
+                       <li>If you just want to run the NUnit tests for System.Data, you would cd into
+                       the mcs source at class/System.Data/Test and run it:
+                               <ul>
+                                       <li>make test</li>
+                               </ul>
+                       </li>
+               </ul>
+       </li>
+               
+</ul>