2003-01-19 Daniel Morgan <danmorg@sc.rr.com>
[mono.git] / web / ado-net
1 * ADO.NET
2
3         <p>Mono's ADO.NET Developers:
4         <ul>
5         <li>rodrigo -AT- ximian.comNOSPAM - <b>Rodrigo Moya</b> - coordinator 
6         for the ADO.NET implementation and works on the OLE DB provider</li>
7         <li>danmorg -AT- sc.rr.comNOSPAM - <b>Daniel Morgan</b> - works on
8         the MySQL, PostgreSQL, and Oracle providers</li>
9         <li>tim -AT- timcoleman.comNOSPAM - <b>Tim Coleman</b> - works on
10         the Microsoft SQL Server, Sybase, and TDS providers</li>
11         <li>brianlritchie -AT- hotmail.comNOSPAM - <b>Brian Ritchie</b> - works on
12         the ODBC provider and the ProviderFactory</li>
13         <li>vladimir -AT- pobox.comNOSPAM - <b>Vladimir Vukicevic</b> - works on
14         the SQL Lite provider</li>
15         <li>cleared -AT- rogers.comNOSPAM - <b>Christopher Bockner</b> - works on
16         the IBM DB2 provider</li>
17         <li>vi64pa -AT- koti.soon.fiNOSPAM - <b>Ville Palo</b> - works on XML stuff in System.Data
18         including DataSet, XmlDataDocument, and has done lots of testing</li>
19         </ul>
20         
21 * Action plan
22
23         <p>The current plan to implement ADO.NET is as follows:
24
25         <ul>
26                 <li>Either create ADO.NET providers or modify pre-exiting ADO.NET providers to
27                 work with Mono</li>
28                 
29                 <ul>
30                         <li>Create ADO.NET Providers
31                         
32                         <ul>
33                                         <li><a href="http://www.go-mono.com/ibmdb2.html">IBM DB2 Universal Database</a></li>
34                                         <li><a href="http://www.go-mono.com/mysql.html">MySQL</a></li>
35                                         <li><a href="http://www.go-mono.com/odbc.html">ODBC</a></li>
36                                         <li><a href="http://www.go-mono.com/oracle.html">Oracle</a></li>
37                                         <li><a href="http://www.go-mono.com/oledb.html">OLE DB</a></li>
38                                         <li><a href="http://www.go-mono.com/postgresql.html">PostgreSQL</a></li>
39                                         <li><a href="http://www.go-mono.com/sqlclient.html">Microsoft SQL Server</a></li>
40                                         <li><a href="http://www.go-mono.com/sqlite.html">SQL Lite</a></li>
41                                         <li><a href="http://www.go-mono.com/sybase.html">Sybase</a></li>
42                                         <li><a href="http://www.go-mono.com/tdsclient.html">TDS Generic</a></li>
43                                         <li>Providers which we do not have, but we would like to have.  Currently,
44                                         some of these databases are supported via the ODBC or OLEDB providers.</li>
45                                         <ul>
46                                                 <li><a href="http://msdn.microsoft.com/library/en-us/dnsql2k/html/sqlxml_intromanagedclasses.asp?frame=true">Managed Classes for SqlXml</a> which is
47                                                 a .NET data provider for retrieving XML data from a Microsoft SQL Server 2000 database.  The System.Data.SqlClient provider
48                                                 in Mono can be used as a starting point at mcs/class/System.Data/System.Data.SqlClient.</li>
49                                                 <li><a href="http://www.hughes.com.au/">miniSQL</a></li>
50                                                 <li><a href="http://www.sleepycat.com/">BerkeleyDB (Sleepycat)</a></li>
51                                                 <li><a href="http://www.sapdb.org/">SapDB</a></li>
52                                                 <li>Microsoft Access - could be done by creating C# bindings to <a href="http://mdbtools.sourceforge.net">MDB Tools</a></li>
53                                                 <li>dbase or xbase type database files</li>
54                                                 <li>Others are welcome</li>
55                                         </ul>
56                                 </ul></li>
57                                 <br>
58                         <li>Modify Pre-existing ADO.NET Providers to work with Mono.  This may
59                         require fixing or implementing areas of Mono too.
60                                 <ul>
61                                         <li><a href="http://www.go-mono.com/firebird.html">Firebird Interbase</a></li>
62                                         <li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a> is a 
63                                            PostgreSQL Managed data provider written 
64                                            in 100% C#, does not require a client library, and works on Mono</li>
65                                         <li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a 
66                                            MySQL Manager data provider written in 100% C#, does not
67                                            require a client library, and works on Mono</li>
68                                 </ul>
69                         </li>
70                 </ul>
71         <br>
72         <li>Create Tools for Configuration, Testing, and Entering SQL Queries  
73         <ul>
74                 <li><b>SQL# CLI - a command-line tool</b> written in C# to 
75                   execute SQL commands,
76                   test connection strings, and connect to various ADO.NET
77                   providers in Mono.  The SQL# CLI can be found in
78                   mcs/tools/SqlSharp/SqlSharpCli.cs</li>
79                   
80                 <li><p><b>SQL# GUI - a GUI tool</b> written in C# to 
81                   execute SQL commands. 
82                   Currently, there is SQL# For GTK# which
83                   can be found at 
84                   mcs/tools/SqlSharp/gui/gtk-sharp  
85                   It has a SQL editor with 
86                   syntax hi lighting of SQL keywords.  This will be
87                   moving to its own cvs modeul sqlsharpgtk.</li>
88                   
89                 <li><b>Configuration Command-Line and GUI Tools for ADO.NET</b>.  
90                   These tools have not been started.  The tools would be written in
91                   C# and run on Mono. The
92                   configuration tool can be used to do the following:
93                   <ul> 
94                         <li>setup DSNs for the ODBC and OLE-DB
95                                 providers and configurations for 
96                                 their underlying libraries (unixODBC and libgda)</li>
97                     <li>setup configurations for the Mono.Data.ProviderFactory
98                                 that Brian Ritchie created</li>
99                     <li>setup native database client library configurations too, such as,
100                                 freetds.conf for Microsoft SQL Server and Sybase</li>
101                   </ul>
102                 </li>
103         </ul>
104 </ul>
105         
106 * Current Status
107
108         <p>Variouls ADO.NET Providers have been created: PostgreSQL, MySQL, Sybase, SQL Lite,
109         Microsoft SQL Server, OLE DB, ODBC, and TDS Generic.  See their respective web page for
110         more information.
111         
112         <p>Constraints need lots of work
113         
114         <p>TypeDataSetGenerator needs to be stubbed and implemented.
115                 
116         <p><b>DataSet, DataAdaptor, DataTable, DataRelation, DataRow, DataColumn,
117         DataColumnCollection, DataRowCollection, and others</b> need more work.  There are
118         many classes that are just stubs and need to be implemented.  
119
120         <p><b>XML support in System.Data</b> needs work.  This involves working on
121         the classes: DataSet, XmlDataDocument, and the method ExecuteXmlReader() that
122         exists in a provider's class that implements IDbCommand, and others.
123         Stuart Caborn has started the XML support in a DataSet.  Tim Coleman started
124         XML support in the ExecuteXmlReader() in a SqlCommand.  Ville Palo has been
125         heavily modifying DataSet, XmlDataDocument, and other classes for reading
126         and writing XML.
127         
128         <p><b>ADO.NET Provider Factory</b> has been started by Brian Ritchie.  The 
129         Provider Factory is way to dynamically create
130         connections, commands, parameters, and data adapters based on configuration information.  The
131         provider factory also provides utility functions needed by a lot of 
132         providers but are not exposed via the provider.  The ProviderFactory
133         is found at mcs/class/Mono.Data and includes a test named test.cs for it in
134         mcs/class/Mono.Data/Test.  Also, take a look at the sample .config file for the
135         test.exe application named test.exe.config.  The .config file is automatically
136         read when you use the Mono.Data.ProviderFactory or Mono.Data.DataTools.
137                 
138         <p><b>Integration with ASP.NET</b> has not been started, such as, data binding
139         to a System.Web.UI.WebControls.DataGrid.  This may involve implementing many classes
140         in System.Web and System.Data. If you want to help, 
141         contact Gonzalo Paniagua Javier. Here is information about using ADO.NET in ASP.NET:
142         <ul>
143                 <li>Take a look at xsp in cvs and look at the examples in test: dbpage1.aspx
144                 and dbpage2.aspx:
145                         <ul>
146                                 <li>Notice that the namespace System.Data is imported via <b>import</b></li>
147                                 <li>A NameValueCollection is gotten using ConfigurationSettings.AppSetings. These
148                                 settings are gotten from the file server.exe.config which is a XML file.   The XML
149                                 file has a section appSettings.  In the appSettings section, you have keys 
150                                 for DBProviderAssembly, DBConnectionType, and DBConnectionString.
151                                 <ul>
152                                         <li><b>DBProviderAssembly</b> is the assembly of the ADO.NET provider.  
153                                               For example: 
154                                               "Mono.Data.PostgreSqlClient"</li>
155                                         <li><b>DBConnectionType</b> is the System.Type of the class that 
156                                               implements System.Data.IDbConnection that is found
157                                           in the DBProviderAssembly.  
158                                           For example: 
159                                           "Mono.Data.PostgreSqlClient.PgConnection"</li> 
160                                     <li><b>DBConnectionString</b> is the ConnectionString to set to the
161                                           IDbConnection object to use in opening a connection to a data source.
162                                           For Example: 
163                                           "hostaddr=127.0.0.1;user=monotest;password=monotest;dbname=monotest"</li>
164                                 </ul>
165                                 <li>The function GetConnectionData() gets the database provider assembly, connection type,
166                                 and connection string parameters if they exist; otherwise, it uses default values.  This is
167                                 done during the loading of the web page.</li>
168                                 <li>With the connection parameters, the assembly is loaded, the connection type is verified that
169                                 it implements IDbConnection and an instance of the class can be created, creates a instance
170                                 of the class, sets the connection string, and opens the connection.</li>
171                         </ul>
172                 </li>
173         </ul>
174         
175         <p><b>Integration with Windows.Forms</b> has not been started, such as, data binding 
176         to a System.Windows.Forms.DataGrid.  This may involve implementing many classes
177         in System.Windows.Forms and System.Data.
178         
179         <p><b>Integration with <a href="http://gtk-sharp.sourceforge.net/">GTK#</a></b> 
180         has not been started, such as, data binding
181         to a GtkTreeView.  This may involve creating new classes
182         to go between the glist data model and the ADO.NET data model.
183         Mike Kestner would be the best person to ask for help on GTK#.
184         
185         <p><b>Integration with QT#</b> has not been started.  Any information on 
186         how this can be done is appreciated.  Adam Treat would be the best 
187         person to ask about QT#.
188         
189         <p><b>Building System.Data</b>
190         
191         <p>The System.Data.dll gets built with the rest of the class library.
192         To compile the System.Data.dll assembly separately, you need:
193
194         <b>On Unix</b>
195
196         <ul>
197                 * update your mono sources. Be sure you have latest mcs.exe
198                   and .dll's, since there have been many fixes needed for
199                   compilation on Linux.
200
201                 * compile System.Data.dll:
202 <pre>
203  cd mcs/class/System.Data<br>
204  mcs --target library -o \
205     System.Data.dll @list
206 </pre>
207         </ul>
208
209         <b>On Windows</b>
210
211         <ul>
212                 * update your mono sources. Be sure you have latest mcs.exe
213                   and .dll's.  You can use the same method as Linux, 
214                   or you can use NAnt.
215
216                 * To use NAnt:
217
218 <pre>
219  cd mcs/class/System.Data
220  ../../nant/NAnt.exe
221 </pre>
222                         
223                 * This will automatically copy the System.Data.dll to Test.
224                   If you need to do a clean for the System.Data.dll assembly,<br><br>
225
226 <pre>
227  cd mcs/class/System.Data
228  ../../nant/NAnt.exe clean 
229 </pre>
230         </ul>
231
232 * Testing
233
234 <ul>
235         <li>Testing connection-oriented classes are done via the provider specific tests
236
237         <li><a href="http://www.go-mono.com/testing.html">Testing non-connection classes</a> are 
238         done via mono's modified version of NUnit.</li>
239
240 </ul>