mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bce5f4a2a | ||
|
|
b741b03a5a | ||
|
|
c79b907d10 | ||
|
|
65c55cae96 | ||
|
|
93512315cf | ||
|
|
a3a8c702a3 | ||
|
|
c1c4fa1ec2 | ||
|
|
6d58b9ec58 | ||
|
|
819f5a345f | ||
|
|
c40860f8f6 | ||
|
|
f8369d1fa5 | ||
|
|
91ce9a2e72 | ||
|
|
e62e81ba8c | ||
|
|
b8c9c45df8 | ||
|
|
51911d4ec6 | ||
|
|
dadd38c671 | ||
|
|
198a9c8cb5 | ||
|
|
da054d8c15 | ||
|
|
eb38dedfbc | ||
|
|
17afb2ed9b | ||
|
|
c4e80b0dd1 | ||
|
|
3d0215ea34 | ||
|
|
1487ef693e | ||
|
|
0262f45d79 | ||
|
|
77ed335185 | ||
|
|
be7cc439dd | ||
|
|
28f2d4e814 | ||
|
|
9f1f45ea46 | ||
|
|
c2c1f1eb56 | ||
|
|
c116a126b9 | ||
|
|
06095010a1 | ||
|
|
a5d23fa8b3 | ||
|
|
2d7a230c66 | ||
|
|
346f3b40cf | ||
|
|
952aca77a6 | ||
|
|
fa79dd6751 | ||
|
|
096e9b19f9 | ||
|
|
381b6f1ebb | ||
|
|
b2a92a5345 | ||
|
|
6b3d5687da | ||
|
|
17531924e3 | ||
|
|
85042b357c | ||
|
|
6b1339c66f | ||
|
|
a408c4a9d1 | ||
|
|
cdc917879e | ||
|
|
5177a232f1 | ||
|
|
268e4491ad | ||
|
|
0745874cc4 | ||
|
|
6c35614385 | ||
|
|
3a1f655546 | ||
|
|
72e4a89785 | ||
|
|
e3a727ab22 | ||
|
|
4d9bb76591 | ||
|
|
810b4b2318 | ||
|
|
bd742a07d0 | ||
|
|
23cb51f860 | ||
|
|
a0b778a04f | ||
|
|
c3b1984cf2 | ||
|
|
66103dd4cf | ||
|
|
15796a43be | ||
|
|
b453e49a64 | ||
|
|
bdde5eb6c0 | ||
|
|
821b52ec63 | ||
|
|
64444c3470 | ||
|
|
15821ea1f0 | ||
|
|
4da2ade4ab | ||
|
|
e58f09a3a2 | ||
|
|
0c20455042 | ||
|
|
128dd6e5b6 | ||
|
|
2df0a310e8 | ||
|
|
854a1cf640 | ||
|
|
cbd0a13cc2 | ||
|
|
6be6743775 | ||
|
|
440e3d7fe4 | ||
|
|
718092ace9 | ||
|
|
b04f04c2d5 | ||
|
|
f0f16e38a5 | ||
|
|
3f4feeb0f7 | ||
|
|
63278cc96d | ||
|
|
72bfd2bba1 | ||
|
|
dfa7dcd7d1 | ||
|
|
63fae5d61b | ||
|
|
b28a8ab0d9 | ||
|
|
f398aabf4f | ||
|
|
f066941cc3 | ||
|
|
9dcc700e9b | ||
|
|
ea7591ceb7 | ||
|
|
1da581452c | ||
|
|
b8d82a392c | ||
|
|
b34b315b1e | ||
|
|
1b8d03bcec | ||
|
|
30df230ca0 | ||
|
|
2bdac9ff23 | ||
|
|
c2a8895543 | ||
|
|
1aa25005bd | ||
|
|
9d4528e27a | ||
|
|
f18ce1d48f | ||
|
|
2f30892999 | ||
|
|
e8db8da7ba | ||
|
|
a06259edc8 | ||
|
|
781b70e8f6 | ||
|
|
72a70777eb | ||
|
|
a69df82208 | ||
|
|
aa99c2edcc | ||
|
|
5cad9df360 | ||
|
|
6d2d918871 | ||
|
|
efbe2a31c0 | ||
|
|
c087cba6d5 | ||
|
|
547d561ec0 | ||
|
|
04909358f2 | ||
|
|
5f0dc4802f | ||
|
|
3349f59a56 | ||
|
|
bc2f767e74 | ||
|
|
012d8753ea | ||
|
|
acb1ad4b9e | ||
|
|
d813976707 | ||
|
|
4fe82568f8 | ||
|
|
4e0359d11f | ||
|
|
52b60d37b1 | ||
|
|
cc5a32b8f2 | ||
|
|
2dd4763647 | ||
|
|
eb83e65c9e | ||
|
|
f998415be5 | ||
|
|
5bf8673afe | ||
|
|
4838dd1e7d | ||
|
|
f7708e260d | ||
|
|
8a2f7c2b73 | ||
|
|
51646007b4 | ||
|
|
cf7a3205de | ||
|
|
bb854a1d37 | ||
|
|
b975015b12 | ||
|
|
a4e1c42dcd | ||
|
|
8c2eea0b3d | ||
|
|
f7f37fe584 | ||
|
|
44577e9e47 | ||
|
|
c34180e2df | ||
|
|
a42443d9ff | ||
|
|
5250b2df7d | ||
|
|
0b1b0d1e17 | ||
|
|
fa79519688 | ||
|
|
8c51f5404f | ||
|
|
d58225f757 | ||
|
|
413b04d360 | ||
|
|
4e4824afab | ||
|
|
7f0542b133 | ||
|
|
9f187b5dd0 |
No files matched your search
@@ -1,3 +1,48 @@
|
||||
2003-01-19 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/ibmdb2: added file which is new web page
|
||||
about IBM DB2 data provider at Mono.Data.DB2Client
|
||||
|
||||
* makefile
|
||||
* commands: added ibmdb2 web page to go-mono web site
|
||||
|
||||
* doc/ado-net: added a couple more developers email, plus made the
|
||||
email spam resistant, added Mono's DB2 data provider to list,
|
||||
added more info about the ProviderFactory and retrieving data using
|
||||
ADO.NET from ASP.NET, add notes about testing, misc cleanup
|
||||
|
||||
* doc/mysql
|
||||
* doc/postgresql
|
||||
* doc/sqlclient
|
||||
* doc/oracle
|
||||
* doc/tdsclient
|
||||
* doc/firebird
|
||||
* doc/oledb
|
||||
* doc/odbc
|
||||
* doc/sybase
|
||||
* doc/sqlite: added testing notes and C# examples
|
||||
|
||||
* doc/gtk-sharp: added links for GTK# for Windows
|
||||
|
||||
* man/sqlsharp.1: added providers Npgsql and MySQLNet
|
||||
|
||||
2003-01-17 Duncan Mak <[email protected]>
|
||||
|
||||
* runtime/Makefile.am: Add the new Mono.Data.DB2Client.dll.
|
||||
|
||||
2003-01-16 Martin Baulig <[email protected]>
|
||||
|
||||
* configure.in (GTHREAD_LIBS, GTHREAD_CFLAGS): Removed the gthread
|
||||
check again, we're now using the mono/io-layer for this.
|
||||
|
||||
Wed Jan 15 16:20:54 CET 2003 Paolo Molaro <[email protected]>
|
||||
|
||||
* configure.in: allow MacOSX (from various people).
|
||||
|
||||
2003-01-14 Martin Baulig <[email protected]>
|
||||
|
||||
* configure.in (GTHREAD_LIBS, GTHREAD_CFLAGS): Added check for gthread.
|
||||
|
||||
2002-12-27 Jeroen Janssen <[email protected]>
|
||||
* fixed url for System.Windows.Forms in the class status
|
||||
|
||||
|
||||
@@ -1,3 +1,104 @@
|
||||
Happy new year!
|
||||
|
||||
The Mono team is proud to release Mono 0.18, with plenty of bug
|
||||
fixes and improvements. If you are a happy 0.17 user, this
|
||||
release is a happiness extension release. Many bugs in the
|
||||
runtime, class libraries and C# compiler have been fixed.
|
||||
|
||||
Also, our special envoy in Japan has reported that there is
|
||||
some naming confussion about the naming of Mono, as can be
|
||||
seen in the following documentary material:
|
||||
|
||||
Atsushi Enomoto shows the source of confussion:
|
||||
|
||||
http://primates.ximian.com/~duncan/gallery/Duncan-in-Tokyo/DSCN0702
|
||||
|
||||
Nick and Duncan echo it:
|
||||
|
||||
http://primates.ximian.com/~duncan/gallery/Duncan-in-Tokyo/DSCN0703
|
||||
|
||||
* Availability
|
||||
|
||||
Mono 0.18 packages and source code is available for download from:
|
||||
|
||||
http://www.go-mono.com/download.html
|
||||
|
||||
Those using Red Carpet on Linux can install Mono 0.18 from
|
||||
the Mono channel. The packages have already been pushed for
|
||||
you.
|
||||
|
||||
At release time we have packages for Red Hat 8.0, 7.3,
|
||||
7.2 and 7.1 and Mandrake 8.2.
|
||||
|
||||
* Contributors to this release
|
||||
|
||||
This release is brought to you by:
|
||||
|
||||
Alejandro Sanchez, Alp Toker, Atsushi Enomoto, Cesar Octavio
|
||||
Lopez Netaren, Daniel Lopez (mod_mono), Daniel Morgan, Dennis
|
||||
Hayes, Dick Porter, Dietmar Maurer, Duncan Mak, Eduardo
|
||||
Garcia, Gaurav Vaish, Gonzalo Paniagua, Jackson Harper, Jaime
|
||||
Anguiano, Jeroen Janssen, Johannes Roith, Jonathan Pryor, Juli
|
||||
Mallett, Lluis Sanchez, Marco Ridoni, Martin Baulig, Miguel de
|
||||
Icaza, Nick Drochak, Paolo Molaro, Patrik Torstensson, Piers
|
||||
Haken, Rachel Hestilow, Rafael Teixeira, Ravi Pratap,
|
||||
Sebastian Pouliot, Tim Coleman, Tim Hayes, Ville Palo, Zoltan
|
||||
Varga.
|
||||
|
||||
* New in this release
|
||||
|
||||
VB.NET compiler:
|
||||
|
||||
Many improvements to the Mono VB.NET compiler.
|
||||
|
||||
ASP.NET:
|
||||
|
||||
Plenty of bug fixes in ASP.NET. Larger applications
|
||||
can now be run with it. The authentication system has
|
||||
been deployed, most changes are from Gonzalo.
|
||||
|
||||
We have a modified IBuySpy running (without Xslt)
|
||||
|
||||
If you want to run ASP.NET you can run it with either
|
||||
our XSP proof-of-concept server, or with Daniel's
|
||||
Apache module that can be fetched from CVS (module
|
||||
name: mod_apache)
|
||||
|
||||
Type Reflector:
|
||||
|
||||
A Console, Gtk# and Windows.Forms tool to browse
|
||||
compiled assemblies and examine the types on it, from
|
||||
Jonathan Pryor.
|
||||
|
||||
Moving to NUnit 2.0
|
||||
|
||||
Nick continues the work on moving our test suite to NUnit 2.0
|
||||
|
||||
Mobile.Controls:
|
||||
|
||||
Gaurav has started work on the Mobile controls, which
|
||||
are required to run some of the reference applications
|
||||
in full-mode like IBuySpy.
|
||||
|
||||
Remoting:
|
||||
|
||||
The remoting infrastructure has got a big boost from
|
||||
Lluis in this release.
|
||||
|
||||
System.Data/XML
|
||||
|
||||
Ville has been working on improving our System.Data
|
||||
classes in the XML assembly.
|
||||
|
||||
Crypto:
|
||||
|
||||
Plenty of new crypto from Sebastien as well. A new
|
||||
web page in our site can be used to track this.
|
||||
|
||||
http://www.go-mono.com/crypto.html
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Hello!
|
||||
|
||||
Version 0.17 of Mono has been released.
|
||||
@@ -106,7 +207,13 @@ Hello!
|
||||
Many regression tests have been added as well (Ville has been
|
||||
doing a great job here).
|
||||
|
||||
Brian also created a DB provider multiplexor (The ProviderFactory)
|
||||
|
||||
Stuart Caborn contributed Writing XML from a DataSet.
|
||||
Luis Fernandez contributed constraint handling code.
|
||||
|
||||
Also there is new a Gtk# GUI tool from Dan that can be used to
|
||||
try out various providers.
|
||||
|
||||
* System.XML:
|
||||
|
||||
|
||||
+11
-2
@@ -1,7 +1,7 @@
|
||||
AC_INIT(README)
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono, 0.17)
|
||||
AM_INIT_AUTOMAKE(mono, 0.18)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
#
|
||||
@@ -43,6 +43,15 @@ case "$host" in
|
||||
AC_DEFINE(NEED_LINK_UNLINK)
|
||||
libmono_cflags="-D_REENTRANT"
|
||||
;;
|
||||
*-*-darwin*)
|
||||
platform_win32=no
|
||||
CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE"
|
||||
libmono_cflags="-D_THREAD_SAFE"
|
||||
LDFLAGS="$LDFLAGS -pthread"
|
||||
AC_DEFINE(NEED_LINK_UNLINK)
|
||||
AC_DEFINE(PTHREAD_POINTER_ID)
|
||||
libdl=
|
||||
;;
|
||||
*)
|
||||
AC_MSG_WARN([*** Please add $host to configure.in checks!])
|
||||
platform_win32=no
|
||||
@@ -487,7 +496,7 @@ i*86-*-*) TARGET=X86; arch_target=x86;;
|
||||
sparc*-*-*) TARGET=SPARC; arch_target=sparc; ACCESS_UNALIGNED="no";;
|
||||
#alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; ACCESS_UNALIGNED="no";;
|
||||
#m68k-*-linux*) TARGET=M68K;;
|
||||
macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | powerpc-*-sysv*) TARGET=POWERPC; arch_target=ppc;;
|
||||
macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | powerpc-*-sysv* | powerpc-*-darwin*) TARGET=POWERPC; arch_target=ppc;;
|
||||
arm-*-linux-* | armv4l-*-linux-*) TARGET=ARM; arch_target=arm; ACCESS_UNALIGNED="no";;
|
||||
s390-*-linux*) TARGET=S390; arch_target=s390; ACCESS_UNALIGNED="no";;
|
||||
esac
|
||||
|
||||
+7
-7
@@ -15,15 +15,15 @@
|
||||
</configSections>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory" />
|
||||
<add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler" />
|
||||
<add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler" />
|
||||
<add verb="*" path="*.config" type="System.Web.HttpForbiddenHandler" />
|
||||
<add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler" />
|
||||
<add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler" />
|
||||
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web" />
|
||||
<add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler, System.Web" />
|
||||
<add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler, System.Web" />
|
||||
<add verb="*" path="*.config" type="System.Web.HttpForbiddenHandler, System.Web" />
|
||||
<add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler, System.Web" />
|
||||
<add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler, System.Web" />
|
||||
</httpHandlers>
|
||||
<httpModules>
|
||||
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
|
||||
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule, System.Web" />
|
||||
</httpModules>
|
||||
<authentication mode="Forms">
|
||||
<forms name=".MONOAUTH" loginUrl="login.aspx" protection="All" timeout="30" path="/">
|
||||
|
||||
+101
-57
@@ -1,39 +1,51 @@
|
||||
* ADO.NET
|
||||
|
||||
The coordinator for the ADO.NET implementation is
|
||||
<a href="mailto:[email protected]">Rodrigo Moya</a>,
|
||||
with the collaboration of:
|
||||
<a href="mailto:[email protected]">Daniel Morgan</a>,
|
||||
<a href="mailto:[email protected]">Tim Coleman</a>,
|
||||
<a href="mailto:[email protected]">Brian Ritchie</a>, and
|
||||
<a href="mailto:[email protected]">Vladimir Vukicevic</a>.
|
||||
<p>Mono's ADO.NET Developers:
|
||||
<ul>
|
||||
<li>rodrigo -AT- ximian.comNOSPAM - <b>Rodrigo Moya</b> - coordinator
|
||||
for the ADO.NET implementation and works on the OLE DB provider</li>
|
||||
<li>danmorg -AT- sc.rr.comNOSPAM - <b>Daniel Morgan</b> - works on
|
||||
the MySQL, PostgreSQL, and Oracle providers</li>
|
||||
<li>tim -AT- timcoleman.comNOSPAM - <b>Tim Coleman</b> - works on
|
||||
the Microsoft SQL Server, Sybase, and TDS providers</li>
|
||||
<li>brianlritchie -AT- hotmail.comNOSPAM - <b>Brian Ritchie</b> - works on
|
||||
the ODBC provider and the ProviderFactory</li>
|
||||
<li>vladimir -AT- pobox.comNOSPAM - <b>Vladimir Vukicevic</b> - works on
|
||||
the SQL Lite provider</li>
|
||||
<li>cleared -AT- rogers.comNOSPAM - <b>Christopher Bockner</b> - works on
|
||||
the IBM DB2 provider</li>
|
||||
<li>vi64pa -AT- koti.soon.fiNOSPAM - <b>Ville Palo</b> - works on XML stuff in System.Data
|
||||
including DataSet, XmlDataDocument, and has done lots of testing</li>
|
||||
</ul>
|
||||
|
||||
|
||||
* Action plan
|
||||
|
||||
<p>The current plan to implement ADO.NET is as follows:
|
||||
|
||||
<ul>
|
||||
<li>Either create ADO.NET providers or modify pre-exiting ADO.NET providers to
|
||||
work with Mono
|
||||
work with Mono</li>
|
||||
|
||||
<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/oracle.html">Oracle</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><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">TDS Generic</a></li>
|
||||
<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.
|
||||
some of these databases are supported via the ODBC or OLEDB providers.</li>
|
||||
<ul>
|
||||
<li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a>
|
||||
<li><a href="http://msdn.microsoft.com/library/en-us/dnsql2k/html/sqlxml_intromanagedclasses.asp?frame=true">Managed Classes for SqlXml</a> which is
|
||||
a .NET data provider for retrieving XML data from a Microsoft SQL Server 2000 database. The System.Data.SqlClient provider
|
||||
in Mono can be used as a starting point at mcs/class/System.Data/System.Data.SqlClient.</li>
|
||||
<li><a href="http://www.hughes.com.au/">miniSQL</a></li>
|
||||
<li><a href="http://www.sleepycat.com/">BerkeleyDB (Sleepycat)</a></li>
|
||||
<li><a href="http://www.sapdb.org/">SapDB</a></li>
|
||||
@@ -41,18 +53,18 @@
|
||||
<li>dbase or xbase type database files</li>
|
||||
<li>Others are welcome</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul></li>
|
||||
<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>
|
||||
<li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a> is a PostgreSQL Managed data provider written
|
||||
in 100% C# and does not require a client library </li>
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a MySQL Manager data provider written in 100% C# and does not
|
||||
require a client library</li>
|
||||
<li><a href="http://sourceforge.net/projects/mysqldrivercs/">MySQLDriverCS</a> is a MySQL data provider written in C#</li>
|
||||
|
||||
<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 Mono</li>
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a
|
||||
MySQL Manager data provider written in 100% C#, does not
|
||||
require a client library, and works on Mono</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -64,13 +76,16 @@
|
||||
test connection strings, and connect to various ADO.NET
|
||||
providers in Mono. The SQL# CLI can be found in
|
||||
mcs/tools/SqlSharp/SqlSharpCli.cs</li>
|
||||
|
||||
<li><p><b>SQL# GUI - a GUI tool</b> written in C# 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>
|
||||
syntax hi lighting of SQL keywords. This will be
|
||||
moving to its own cvs modeul sqlsharpgtk.</li>
|
||||
|
||||
<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
|
||||
@@ -93,6 +108,10 @@
|
||||
<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>Constraints need lots of work
|
||||
|
||||
<p>TypeDataSetGenerator needs to be stubbed and implemented.
|
||||
|
||||
<p><b>DataSet, DataAdaptor, DataTable, DataRelation, DataRow, DataColumn,
|
||||
DataColumnCollection, DataRowCollection, and others</b> need more work. There are
|
||||
@@ -102,19 +121,56 @@
|
||||
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.
|
||||
XML support in the ExecuteXmlReader() in a SqlCommand. Ville Palo has been
|
||||
heavily modifying DataSet, XmlDataDocument, and other classes for reading
|
||||
and writing XML.
|
||||
|
||||
<p><b>ADO.NET Provider Factory</b> has been started by Brian Ritchie. The
|
||||
Provider Factory is used to dynamically create
|
||||
connections, commands, parameters, 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.
|
||||
Provider Factory is way to dynamically create
|
||||
connections, commands, parameters, and data adapters based on configuration information. The
|
||||
provider factory also provides utility functions needed by a lot of
|
||||
providers but are not exposed via the provider. The ProviderFactory
|
||||
is found at mcs/class/Mono.Data and includes a test named test.cs for it in
|
||||
mcs/class/Mono.Data/Test. Also, take a look at the sample .config file for the
|
||||
test.exe application named test.exe.config. The .config file is automatically
|
||||
read when you use the Mono.Data.ProviderFactory or Mono.Data.DataTools.
|
||||
|
||||
<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:[email protected]">Gonzalo Paniagua Javier</a>
|
||||
in System.Web and System.Data. If you want to help,
|
||||
contact Gonzalo Paniagua Javier. Here is information about using ADO.NET in ASP.NET:
|
||||
<ul>
|
||||
<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:
|
||||
"Mono.Data.PostgreSqlClient"</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:
|
||||
"Mono.Data.PostgreSqlClient.PgConnection"</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>
|
||||
|
||||
<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
|
||||
@@ -130,27 +186,6 @@
|
||||
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>Building System.Data</b>
|
||||
|
||||
<p>The System.Data.dll gets built with the rest of the class library.
|
||||
@@ -194,3 +229,12 @@
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
* Testing
|
||||
|
||||
<ul>
|
||||
<li>Testing connection-oriented classes are done via the provider specific tests
|
||||
|
||||
<li><a href="http://www.go-mono.com/testing.html">Testing non-connection classes</a> are
|
||||
done via mono's modified version of NUnit.</li>
|
||||
|
||||
</ul>
|
||||
+33
-56
@@ -9,8 +9,8 @@
|
||||
|
||||
There is work underway for both systems. The Web Forms
|
||||
support is more advanced at this point, and various ".aspx"
|
||||
programs can be run using the Mono runtime and the XSP page
|
||||
parser.
|
||||
programs can be run using the Mono runtime (embedded into
|
||||
either the XSP server or the mod_mono Apache module).
|
||||
|
||||
We are now working bug fixing and adding missing features
|
||||
after making the whole pipeline compatible with MS.
|
||||
@@ -21,41 +21,6 @@
|
||||
Web Services support. Work for the supporting class libraries
|
||||
just started recently.
|
||||
|
||||
* Web Forms: The pieces
|
||||
|
||||
There are a couple of components to the puzzle:
|
||||
|
||||
<ul>
|
||||
* .aspx page parser (converts .aspx to C# code).
|
||||
|
||||
* System.Web.HttpRuntime support.
|
||||
|
||||
* Web controls (System.Web.UI.HtmlControls and
|
||||
System.Web.UI.WebControls).
|
||||
|
||||
* Underlying infrastructure for the controls (System.Web.UI).
|
||||
|
||||
* HttpRuntime.ProcessRequest is the core of the ASP.NET
|
||||
implementation.
|
||||
</ul>
|
||||
|
||||
|
||||
Gonzalo has been working on an ASP.NET parser that takes .aspx
|
||||
files and generated the code required to run them (the code lives in
|
||||
module `xsp' along with a little web server for testing).
|
||||
|
||||
Most of the runtime support was written by Patrik Torstensson
|
||||
(now at Intel). This was interesting, because in order to implement
|
||||
some of its features, Patrik had to go into the runtime/JIT engine and
|
||||
he spent a few weeks doing work there.
|
||||
|
||||
The classes for running ASP.NET are being actively written.
|
||||
Gaurav, Leen and Patrik worked in the core of the classes
|
||||
required to run ASP.NET web application as well as a small
|
||||
embeddable web server.
|
||||
|
||||
Duncan got our System.Web assembly to compile.
|
||||
|
||||
** HttpRuntime
|
||||
|
||||
Patrik has authored most of the HttpRuntime support (both on
|
||||
@@ -104,29 +69,41 @@
|
||||
over the web probably do not want to use direct ASP.NET but a
|
||||
wrapper around it.
|
||||
|
||||
** Roadmap
|
||||
* Web Forms: The pieces (historical)
|
||||
|
||||
1. The Parser.
|
||||
There are a couple of components to the puzzle:
|
||||
|
||||
2. Get the parser to generate output compatible with ASP.NET.
|
||||
|
||||
3. Run the sample output with the real Microsoft runtime
|
||||
but using our generated page.
|
||||
|
||||
4. Run the sample with our classes with the .NET runtime.
|
||||
|
||||
5. Run the samples with our classes with the our runtime (without
|
||||
using HttpRuntime).
|
||||
|
||||
6. Finish HttpRuntime.
|
||||
<ul>
|
||||
* .aspx page parser (converts .aspx to C# code).
|
||||
|
||||
7. Running our sample code with our classes with our runtime.
|
||||
|
||||
8. Debug and add missing features.
|
||||
|
||||
We are in step 8. Among the missing features: server side includes,
|
||||
better caching, some configuration stuff, more validators...
|
||||
* System.Web.HttpRuntime support.
|
||||
|
||||
* Web controls (System.Web.UI.HtmlControls and
|
||||
System.Web.UI.WebControls).
|
||||
|
||||
* Underlying infrastructure for the controls (System.Web.UI).
|
||||
|
||||
* HttpRuntime.ProcessRequest is the core of the ASP.NET
|
||||
implementation.
|
||||
</ul>
|
||||
|
||||
|
||||
Gonzalo has been working on an ASP.NET parser that takes .aspx
|
||||
files and generated the code required to run them (the code lives in
|
||||
module `xsp' along with a little web server for testing).
|
||||
|
||||
Most of the runtime support was written by Patrik Torstensson
|
||||
(now at Intel). This was interesting, because in order to implement
|
||||
some of its features, Patrik had to go into the runtime/JIT engine and
|
||||
he spent a few weeks doing work there.
|
||||
|
||||
The classes for running ASP.NET are being actively written.
|
||||
Gaurav, Leen and Patrik worked in the core of the classes
|
||||
required to run ASP.NET web application as well as a small
|
||||
embeddable web server.
|
||||
|
||||
Duncan got our System.Web assembly to compile.
|
||||
|
||||
** How to Help
|
||||
|
||||
Testing and fixing HtmlControls, WebControls and validators is an
|
||||
|
||||
+28
-33
@@ -13,7 +13,9 @@
|
||||
<ul>
|
||||
* Every classes are present.
|
||||
|
||||
* Most classes have their unit tests.
|
||||
* Most classes have their unit tests. Some tests like <code>
|
||||
SymmetricAlgorithmTest</code> are generated by an external
|
||||
tool.
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
@@ -77,20 +79,21 @@
|
||||
nor the certificate chain (and we're still missing some trust
|
||||
anchors).
|
||||
|
||||
* Integration with CryptoAPI isn't possible as long as the
|
||||
<code>X509Certificate(IntPtr)</code> constructor isn't
|
||||
completed.
|
||||
* Integration with CryptoAPI (on Windows) isn't possible as
|
||||
long as the <code>X509Certificate(IntPtr)</code> constructor
|
||||
isn't completed.
|
||||
</ul>
|
||||
|
||||
**** Notes
|
||||
<ul>
|
||||
* <b>There's no validation of the certificates</b> done in this
|
||||
class (this isn't a restriction of Mono!). This means that
|
||||
certificate signatures and validity dates are never checked!
|
||||
certificate signatures and validity dates are <b>never</b>
|
||||
checked!
|
||||
|
||||
* The newer X509Certificate class included in Microsoft's Web
|
||||
Service Enhancement (WSE) is a little better (as it includes
|
||||
validation).
|
||||
CryptoAPI's validation) when <code>IsCurrent</code> is called.
|
||||
|
||||
* Microsoft implementation of <code>X509Certificate</code> is
|
||||
done by using CryptoAPI. From the exceptions thrown
|
||||
@@ -102,8 +105,9 @@
|
||||
|
||||
*** Namespace: <b>System.Security.Cryptography.Xml</b>
|
||||
|
||||
This namespace implements the XML Digital Signature specification from
|
||||
W3C.
|
||||
This namespace implements the <a href="http://www.w3.org/TR/xmldsig-core/">
|
||||
XML Digital Signature</a> specification from
|
||||
<a href="http://www.w3.org/">W3C</a>.
|
||||
|
||||
**** Status
|
||||
<ul>
|
||||
@@ -111,38 +115,25 @@
|
||||
|
||||
* Most classes have their unit tests.
|
||||
|
||||
* This assembly is present in CVS but isn't (yet) part of the
|
||||
build.
|
||||
* This assembly is present in CVS but only available when
|
||||
building using NAnt (i.e. makefile are missing).
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
<ul>
|
||||
* All the transforms needs to be done. But this requires far
|
||||
more XML knowledge than crypto.
|
||||
more XML knowledge than crypto. Note: Most tests runs because
|
||||
the feeded XML is pre-c14n (by hand in the code) before
|
||||
signing (not because the transforms works).
|
||||
|
||||
* Fix the tests (see notes) then include the assembly into the
|
||||
build process.
|
||||
</ul>
|
||||
|
||||
**** Notes
|
||||
<ul>
|
||||
* Many current tests fails because the XML generated by Mono
|
||||
isn't exactly the same as the one produced by the Microsoft
|
||||
implementation (but 100% equivalent). We'll either have to
|
||||
change the XML code or the tests.
|
||||
|
||||
* Testing is difficult because the classes use CryptoConfig
|
||||
to create the required cryptographic objects. When running
|
||||
the unit tests the CryptoConfig executing is the one in
|
||||
mscorlib (not Mono's one) so it doesn't return the expected
|
||||
objects. This results in InvalidCastException.
|
||||
* Makefile for building under non-Windows operating systems.
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
** Assembly: Mono.Security.Win32
|
||||
|
||||
This assembly is to provide maximum compatibility with CryptoAPI to
|
||||
application running with Mono's runtime on the Windows operating
|
||||
This assembly goal is to provide maximum compatibility with CryptoAPI
|
||||
to application running with Mono's runtime on the Windows operating
|
||||
system.
|
||||
|
||||
<b>This assembly should NEVER be used directly by any application</b>.
|
||||
@@ -156,7 +147,8 @@
|
||||
<ul>
|
||||
* A RNGCryptoServiceProvider built on top of CryptoAPI.
|
||||
|
||||
* Not (yet) commited in CVS.
|
||||
* Not (yet) commited in CVS - i'm still playing with the base
|
||||
classes so I can easily add other CryptoAPI-based algorithms.
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
@@ -179,7 +171,8 @@
|
||||
certificates.
|
||||
|
||||
Note: WSE is distributed as an add-on because the WS-Security
|
||||
specification isn't yet completed by OASIS.
|
||||
specification isn't yet completed by
|
||||
<a href="http://www.oasis-open.org/committees/wss/">OASIS</a>.
|
||||
|
||||
<b>There are some licensing issues to consider before stating to
|
||||
implement WS-Security. All contributors must sign an agreement with
|
||||
@@ -267,8 +260,8 @@
|
||||
Add missing unit tests to classes or methods.
|
||||
|
||||
Write some documentation on the cryptographic classes for MonkeyGuide
|
||||
(as I'm not a good writer - but you must be a good reader if you got to
|
||||
this part).
|
||||
(as I'm not a good writer, at least in English, but you must be a good
|
||||
reader if you got to this part).
|
||||
|
||||
Optimization can also be done on algorithms as crypto is never fast
|
||||
enough. Just be sure to test every optimization (using the unit test)
|
||||
@@ -278,3 +271,5 @@
|
||||
, <a href="mailto:[email protected]">work</a>) if you need additional
|
||||
informations about the status of the cryptographic classes.
|
||||
|
||||
<hr>
|
||||
Last reviewed: January 19, 2003 (post mono 0.18)
|
||||
+137
-90
@@ -13,6 +13,141 @@
|
||||
section</a>, the <a
|
||||
href="http://www.go-mono.org/faq.html">FAQ</a>.
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="#DDDDDD">
|
||||
<td>
|
||||
<b>Release 0.18</b><br>
|
||||
<a href="archive/mono-0.18">Release notes</a><br>
|
||||
Jan 12th, 2003
|
||||
</td>
|
||||
<td>
|
||||
<table cellspacing="1" cellpadding="3">
|
||||
<tr bgcolor="#BBBBBB">
|
||||
<td>
|
||||
<b>Source Code</b>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li><a href="archive/mcs-0.18.tar.gz">Mono Class Libraries and C# Compiler.</a>
|
||||
<li><a href="archive/mono-0.18.tar.gz">Mono Runtime</a>
|
||||
<li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
|
||||
<li><a href="archive/xsp-0.2.tar.gz">XSP web server</a> <b><font color="#dd0000">New!</font></b>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr bgcolor="#BBBBBB">
|
||||
<td>
|
||||
<b>Source RPMs</b><br>
|
||||
(No RPMS for XSP).
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
|
||||
<li><a href="archive/mono-0.18-1.src.rpm">mono-0.18-1.src.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.3/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-73-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-0.18-1.i386.rpm">mono-0.18-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-devel-0.18-1.i386.rpm">mono-devel-0.18-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-72-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-0.18-1.i386.rpm">mono-0.18-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-devel-0.18-1.i386.rpm">mono-devel-0.18-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.1/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-71-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-0.18-1.i386.rpm">mono-0.18-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-devel-0.18-1.i386.rpm">mono-devel-0.18-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Mandrake 8.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-6.1-1.i586.rpm">libgc-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-devel-6.1-1.i586.rpm">libgc-devel-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-0.18-1.i586.rpm">mono-0.18-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-devel-0.18-1.i586.rpm">mono-devel-0.18-1.i586.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- <td bgcolor="#999999"> -->
|
||||
<!-- <b>SuSE 8.0/x86</b> -->
|
||||
<!-- <ul> -->
|
||||
<!-- <li><a href="archive/suse-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a> -->
|
||||
<!-- <li><a href="archive/suse-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a> -->
|
||||
<!-- <li><a href="archive/suse-80-i386/mono-0.17-1.i386.rpm">mono-0.17-1.i386.rpm</a> -->
|
||||
<!-- <li><a href="archive/suse-80-i386/mono-devel-0.17-1.i386.rpm">mono-devel-0.17-1.i386.rpm</a> -->
|
||||
<!-- </ul> -->
|
||||
<!-- </td> -->
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-0.18-1.i386.rpm">mono-0.18-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-devel-0.18-1.i386.rpm">mono-devel-0.18-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<!-- <b>Windows Setup Wizard (NT/2000/XP)</b>␍ -->
|
||||
<!-- <ul>␍ -->
|
||||
<!-- <li><a href="archive/mono-0.17-stable.exe">Mono-Setup</a>␍ -->
|
||||
<!-- </ul>␍ -->
|
||||
<!-- </td>␍ -->
|
||||
<td bgcolor="#999999">
|
||||
<b>Debian packages</b>
|
||||
<ul>
|
||||
<li><a href="http://www.atoker.com/mono/">Alp's web site</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr bgcolor="#CCCCC">
|
||||
<td>
|
||||
<b>Regression Tests</b><br>
|
||||
</td>
|
||||
<td>
|
||||
You can get binaries for the Mono Regression Test
|
||||
Suite <a href="archive/mono-tests.tar.gz">here</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<br>
|
||||
* Older Releases:
|
||||
|
||||
We provide binaries for older releases until we have packages for the new release.
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="#DDDDDD">
|
||||
@@ -32,7 +167,6 @@
|
||||
<li><a href="archive/mcs-0.17.tar.gz">Mono Class Libraries and C# Compiler.</a>
|
||||
<li><a href="archive/mono-0.17.tar.gz">Mono Runtime</a>
|
||||
<li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
|
||||
<li><a href="archive/xsp-0.2.tar.gz">XSP web server</a> <b><font color="#dd0000">New!</font></b>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -48,69 +182,6 @@
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.3/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-73-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-0.17-2.i386.rpm">mono-0.17-2.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-devel-0.17-2.i386.rpm">mono-devel-0.17-2.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-72-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-0.17-2.i386.rpm">mono-0.17-2.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-devel-0.17-2.i386.rpm">mono-devel-0.17-2.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.1/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-71-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-0.17-2.i386.rpm">mono-0.17-2.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-devel-0.17-2.i386.rpm">mono-devel-0.17-2.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Mandrake 8.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-6.1-1.i586.rpm">libgc-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-devel-6.1-1.i586.rpm">libgc-devel-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-0.17-2.i586.rpm">mono-0.17-2.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-devel-0.17-2.i586.rpm">mono-devel-0.17-2.i586.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>SuSE 8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/suse-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-0.17-1.i386.rpm">mono-0.17-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-devel-0.17-1.i386.rpm">mono-devel-0.17-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-0.17-2.i386.rpm">mono-0.17-2.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-devel-0.17-2.i386.rpm">mono-devel-0.17-2.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Windows Setup Wizard (NT/2000/XP)</b>
|
||||
@@ -128,26 +199,10 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr bgcolor="#CCCCC">
|
||||
<td>
|
||||
<b>Regression Tests</b><br>
|
||||
</td>
|
||||
<td>
|
||||
You can get binaries for the Mono Regression Test
|
||||
Suite <a href="archive/mono-tests.tar.gz">here</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
* Older Releases:
|
||||
|
||||
We provide binaries for older releases until we have packages for the new release.
|
||||
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="#DDDDDD">
|
||||
@@ -190,7 +245,7 @@
|
||||
<ul>
|
||||
<li><a href="archive/s390/glib2-2.0.6-13.s390.rpm">glib2-2.0.6-13.s390.rpm</a>
|
||||
<li><a href="archive/s390/glib2-devel-2.0.6-13.s390.rpm">glib2-devel-2.0.6-13.s390.rpm</a>
|
||||
<li><a href="archive/s390/libgc-6.1alpha5-1.s390.rpm">libgc-6.1alpha5-1.s390.rpm</a>
|
||||
p <li><a href="archive/s390/libgc-6.1alpha5-1.s390.rpm">libgc-6.1alpha5-1.s390.rpm</a>
|
||||
<li><a href="archive/s390/libgc-devel-6.1alpha5-1.s390.rpm">libgc-devel-6.1alpha5-1.s390.rpm</a>
|
||||
<li><a href="archive/s390/mono-0.16-1.s390.rpm">mono-0.16-1.s390.rpm</a>
|
||||
<li><a href="archive/s390/mono-devel-0.16-1.s390.rpm">mono-devel-0.16-1.s390.rpm</a>
|
||||
@@ -201,14 +256,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr bgcolor="#CCCCC">
|
||||
<td>
|
||||
<b>Regression Tests</b><br>
|
||||
</td>
|
||||
<td>
|
||||
You can get binaries for the Mono Regression Test
|
||||
Suite <a href="archive/mono-tests.tar.gz">here</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -547,4 +594,4 @@ make install
|
||||
|
||||
Notice that following the above procedure does not require you
|
||||
to manually install the software in the `mcs' directory, as
|
||||
the relevant files will be copied by the `mono' makefiles.
|
||||
the relevant files will be copied by the `mono' makefiles.
|
||||
+78
-3
@@ -8,7 +8,7 @@
|
||||
by Borland under the Interbase Public License</li>
|
||||
|
||||
<li>Both the Firebird Relational Database and the Firebird .NET Data Provider can be
|
||||
downloaded from <a href="http://sourceforge.net/projects/firebird/firebird">here</a></li>
|
||||
downloaded from <a href="http://sourceforge.net/projects/firebird/">here</a></li>
|
||||
|
||||
<li>The Firebird .NET Data provider has been made
|
||||
available by Carlos Guzmán Álvarez (aka "Carlos G.A."), who has also made a
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
** Current Status
|
||||
|
||||
<ul>
|
||||
<li>Currently, it is able to connect to Firebird and Interbase databases
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
</ul>
|
||||
|
||||
* Action Plan
|
||||
** Action Plan
|
||||
|
||||
<ul>
|
||||
<li>Bug fixing</li>
|
||||
@@ -98,3 +98,78 @@
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Testing
|
||||
|
||||
<ul>
|
||||
<li>Need a working mono and mcs</li>
|
||||
<li>Need access to a Firebird Relational Database or you can download
|
||||
it from <a href="http://firebird.sourceforge.net">here</a></li>
|
||||
<li>Get the Firebird .NET data provider from here as
|
||||
<a href="http://lists.sourceforge.net/lists/listinfo/firebird-net-provider">firebird-net-provider</a>. Make
|
||||
sure the Firebird .NET data provider binary assembly FirebirdSql.Data.Firebird.dll is
|
||||
installed in the same place as the mono class libraries.</li>
|
||||
<li>C# Example for Mono's System.Data.OleDb:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using FirebirdSql.Data.Firebird;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Database=C:\\PROGRAM FILES\\FIREBIRD\\EXAMPLES\\EMPLOYEE.GDB;" +
|
||||
"User=SYSDBA;" +
|
||||
"Password=masterkey;" +
|
||||
"Dialect=3;" +
|
||||
"Server=localhost";
|
||||
IDbConnection dbcon = new FbConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql = "SELECT * FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
object dataValue = myReader.GetValue(0);
|
||||
string sValue = dataValue.ToString();
|
||||
Console.WriteLine("Value: " + sValue);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll \
|
||||
-r FirebirdSql.Data.Firebird.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll -r FirebirdSql.Data.Firebird.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
+132
-6
@@ -3,19 +3,145 @@
|
||||
<a href="http://gtk-sharp.sourceforge.net">Gtk#</a> (Gtk
|
||||
sharp) is a set of C# language bindings for the
|
||||
<a href="http://www.gtk.org">Gtk+</a> toolkit and other
|
||||
libraries that are part of the <a
|
||||
href="http://www.gnome.org">GNOME</a> platform .
|
||||
libraries that are part of the
|
||||
<a href="http://www.gnome.org">GNOME</a> platform .
|
||||
|
||||
** API of Gtk#
|
||||
|
||||
The API is browsable
|
||||
<a
|
||||
href="http://primates.ximian.com/~tvgm/gtk-sharp-docs/">here</a>
|
||||
<a href="http://primates.ximian.com/~tvgm/gtk-sharp-docs/">here</a>
|
||||
|
||||
** Where to learn more.
|
||||
|
||||
Visit the official site for the <a
|
||||
href="http://gtk-sharp.sourceforge.net">Gtk# Project</a>.
|
||||
Visit the official site for the <a href="http://gtk-sharp.sourceforge.net">Gtk# Project</a>.
|
||||
The <a href="http://www.go-mono.org/faq">Mono FAQ</a> has some useful
|
||||
information too.
|
||||
|
||||
** GTK# On Linux
|
||||
|
||||
<p>Where to get distributions of GTK# for Linux: TODO
|
||||
|
||||
<p>Buidling on Linux:
|
||||
|
||||
<ul>
|
||||
<li>Get GTK# source from <a href="http://gtk-sharp.sourceforge.net">Gtk# Project</a>.</li>
|
||||
<li>run ./autogen.sh --prefix=my_mono_installation_prefix</li>
|
||||
<li>make</li>
|
||||
<li>make install</li>
|
||||
</ul>
|
||||
|
||||
** GTK# On Windows
|
||||
|
||||
<p>There is a Windows Installer for GTK# <a href="http://www.sport-huettn.de/mono/gtk-sharp-0.6-stable-2.exe">here</a>.
|
||||
|
||||
<p>If you want to build GTK# yourself on Windows:
|
||||
|
||||
<p>To build gtk# under windows, you will need the following:
|
||||
|
||||
<ul>
|
||||
<li>cygwin from <a href="http://www.cygwin.com/">here</a> When installing Cygwin via setup.exe,
|
||||
by default binutils and other tools do not get installed; you have to make
|
||||
sure to select these items. Just make
|
||||
sure Base and Development are set to Install.</li>
|
||||
<li>Mono 0.17 or later from <a href="http://www.go-mono.com/download.html">here</a>
|
||||
You can use Windows Setup Wizard (NT/2000/XP).</li>
|
||||
<li>GTK+ 2.0 (and dependencies). You can obtain gtk+ 2.0 by either of the
|
||||
following:
|
||||
<ul>
|
||||
<li>You can get a Windows Installer at:
|
||||
<a href="http://www.dropline.net/jade/download.html">here</a> </li>
|
||||
<li>or get the separate binary and dev/lib packages at
|
||||
at <a href="http://www.gimp.org/~tml/gimp/win32/downloads.html">here</a> </li>
|
||||
<li>or binary package from Dev-C++ site <a href="http://www.bloodshed.net/dev/packages/gtk.html">here</a> </li>
|
||||
<li>or get Gtk4Win <a href="http://wingtk.sourceforge.net/index.html">here</a> </li>
|
||||
<li>or the source at <a href="http://www.gtk.org/">here</a> </li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>binary distriubtion of a current web browser
|
||||
like Internet Explorer 4.0, Mozilla 1.0, or Netscape 7.0 which
|
||||
includes things like msvcrt.dll.</li>
|
||||
<li>Microsoft .NET Framework at
|
||||
<a href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true">here</a> </li>
|
||||
|
||||
<p>If you are running Windows 95/98/ME, then you will need Unicode support.
|
||||
Look in
|
||||
mono-list archives for information about how to get
|
||||
Mono to work on Windows 9x.
|
||||
<a href="http://lists.ximian.com/archives/public/mono-list/2002-December/004158.html">here</a>
|
||||
|
||||
<p>Environment Variables to set:
|
||||
<ul>
|
||||
<li>PATH - set to your mono installation bin and lib path.
|
||||
For example, my mono installation prefix is:
|
||||
<pre>
|
||||
F:/cygwin/home/DanielMorgan/mono/install
|
||||
</pre>
|
||||
<p>So, I would set my PATH in the Windows Control Panel as:
|
||||
<pre>
|
||||
F:/cygwin/home/DanielMorgan/mono/install/bin;F:/cygwin/home/DanielMorgan/mono/install/lib</li>
|
||||
</pre>
|
||||
</li>
|
||||
<li>LD_LIBRARY_PATH - set to your mono installation lib path</li>
|
||||
<li>PKG_CONFIG_PATH - set to your mono installation lib/pkgconfig path, such
|
||||
as,
|
||||
<pre>
|
||||
F:/cygwin/home/DanielMorgan/mono/install/lib/pkgconfig</li>
|
||||
</pre>
|
||||
|
||||
<p>If you got the gtk-sharp source, cd to the gtk-sharp directory, type:
|
||||
<pre>
|
||||
./autogen.sh --prefix=~/mono/install
|
||||
</pre>
|
||||
|
||||
<p>Set your --prefix= to whatever your mono installation prefix is located.
|
||||
This will take awhile to go through the ./autogen.sh and ./configure...
|
||||
|
||||
<p>After that it finishes succesfully, you run make with the makefile.win32
|
||||
like:
|
||||
<pre>
|
||||
make -f makefile.win32
|
||||
</pre>
|
||||
|
||||
<p>After that finishes succesfully, you can copy to your mono installation lib
|
||||
path like:
|
||||
<pre>
|
||||
cp */*.dll ~/mono/install/lib
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
<p>The pkg-config files for
|
||||
gtk+ 2.0 and dependencies will need to be set correctly if they haven't
|
||||
already been.
|
||||
|
||||
<p>Look in your mono installation/lib/pkgconfig, such as,
|
||||
<pre>
|
||||
F:/cygwin/home/DanielMorgan/mono/install/lib/pkgconfig
|
||||
</pre>
|
||||
|
||||
<p>You will find files like: gtk+-2.0.pc
|
||||
|
||||
<p>Edit the line that says
|
||||
|
||||
<pre>
|
||||
prefix=something
|
||||
</pre>
|
||||
|
||||
<p>And set it to your mono installation prefix, such as,
|
||||
|
||||
<pre>
|
||||
prefix=F:/cygwin/home/DanielMorgan/mono/install
|
||||
</pre>
|
||||
|
||||
<p>Do this for all the .pc files in that directory. If there are not any, then
|
||||
you will need to create them. Or get them from somewhere like the dev
|
||||
packages at
|
||||
<a href="http://www.gimp.org/~tml/gimp/win32/downloads.html">here</a>
|
||||
|
||||
|
||||
** GTK# On Solaris
|
||||
|
||||
TODO
|
||||
|
||||
** GTK# On AIX
|
||||
|
||||
TODO
|
||||
Executable
+132
@@ -0,0 +1,132 @@
|
||||
* IBM DB2 Data Provider
|
||||
<ul>
|
||||
<li>Exists in namespace DB2ClientCS and assembly Mono.Data.DB2Client</li>
|
||||
|
||||
<li>The source code exists at mcs/class/Mono.Data.DB2Client</li>
|
||||
|
||||
<li>Requires the Call Level Interface to IBM DB2 shared library. This
|
||||
is db2cli.dll on Windows. The IBM DB2 CLI API is very similar to the ODBC API. If
|
||||
you take a look at Mono's System.Data.Odbc ODBC provider, you will see the
|
||||
DllImport's have similiar function names.</li>
|
||||
|
||||
<li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a> can be downloaded from IBM.</li>
|
||||
|
||||
<li>IBM DB2 Provider created by Christopher Bockner.</li>
|
||||
</ul>
|
||||
|
||||
** Current Status
|
||||
|
||||
<ul>
|
||||
<li>Compiles on Windows and Linux. Works on Windows. Still needs to be tested on Linux.</li>
|
||||
|
||||
<li>Able to connect to IBM DB2</li>
|
||||
|
||||
<li>Able to execute DML, such as, CREATE TABLE via ExecuteNonQuery()</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Action Plan
|
||||
|
||||
<ul>
|
||||
<li>Still needs work to get it to retrieve data via ExecuteReader() and
|
||||
use the data reader to read data.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Testing
|
||||
|
||||
In order to test.
|
||||
<ul>
|
||||
<li>Have working mono and mcs setup</li>
|
||||
|
||||
<li>Have access to an IBM DB2 database. If you do not have access, download the
|
||||
<a href="http://www-3.ibm.com/software/data/db2/">IBM DB2</a> software. There
|
||||
are versions for Windows, Linux, AIX, and Sun Solaris.</li>
|
||||
|
||||
<li>Make sure the assembly Mono.Data.DB2Client.dll was built and installed
|
||||
where the other class libraries are installed.</li>
|
||||
|
||||
<li>If you do not have the source to mcs, get the source from
|
||||
<a href="http://www.go-mono.com/download">here</a></li>
|
||||
|
||||
<li>In mcs/class/Mono.Data.DB2Client/Test/DBConnTest, you will find
|
||||
a DBConnTest.cs.</li>
|
||||
|
||||
<li>To build DBConnTest:
|
||||
<ul>
|
||||
<li>On Unix:</li>
|
||||
<pre>
|
||||
mcs DBConnTest.cs -r System.Data.dll -r Mono.Data.DB2Client.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>On Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe DBConnTest.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll -r Mono.Data.DB2Client.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>To run it on mono:
|
||||
<pre>
|
||||
mono DBConnTest.exe database userid password
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using Mono.Data.DB2Client;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"DSN=sample;UID=db2admin;PWD=mypass";
|
||||
IDbConnection dbcon = new DB2ClientConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"CREATE TABLE mono_db2_test1 ( " +
|
||||
" testid varchar(2), " +
|
||||
" testdesc varchar(16) " +
|
||||
")";
|
||||
dbcmd.ConnectionString = sql;
|
||||
dbcmd.ExecuteNonQuery();
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll \
|
||||
-r Mono.Data.DB2Client.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll -r Mono.Data.DB2Client.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -91,6 +91,24 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@item Jan, 17th: DB2 provider, MacOS X
|
||||
|
||||
Christopher Bockner has contributed a DB2 System.Data client.
|
||||
|
||||
MacOS X support on the runtime has been integrated into the
|
||||
distribution, and MCS works with it.
|
||||
|
||||
Zoltan has managed to get <a
|
||||
href="http://radio.weblogs.com/0109845/">IKVM</a> (a Java VM
|
||||
for .NET) to run with Mono. The HelloWorld.class runs with
|
||||
the Mono runtime.
|
||||
|
||||
@item Jan, 13th, 2003: Mono 0.18 released
|
||||
|
||||
Mono 0.18 has been released. Check out the <a
|
||||
href="archive/mono-0.18">release notes</a> for an overview of
|
||||
the changes. You can get it <a href="download.html">here</a>.
|
||||
|
||||
@item Jan 10th, 2003: Mono Weekly News.
|
||||
|
||||
A new issue of the <a
|
||||
|
||||
@@ -3,27 +3,32 @@
|
||||
<ul>
|
||||
<li>MySQL Data Provider for
|
||||
<a href="http://www.mysql.com/">MySQL</a> databases. It is written in C# and uses
|
||||
the MySQL C Client Library
|
||||
the MySQL C Client Library</li>
|
||||
|
||||
<li>Exists in namespace Mono.Data.MySql and assembly Mono.Data.MySql
|
||||
<li>Exists in namespace Mono.Data.MySql and assembly Mono.Data.MySql</li>
|
||||
|
||||
<li>Works on Windows and Linux via the MySQL client shared library
|
||||
(libmySQL.dll on Windows and libmysqlclient.so on Linux).
|
||||
(libmySQL.dll on Windows and libmysqlclient.so on Linux).</li>
|
||||
|
||||
<li>Started by Daniel Morgan using C# Bindings to MySQL from Brad Meril.
|
||||
<li>Started by Daniel Morgan using
|
||||
<a href="http://www.cybercom.net/~zbrad/DotNet/MySql/">C# Bindings to MySQL</a> from <a href="mailto:[email protected]">Brad Merill</a>
|
||||
|
||||
<li><a href="http://www.mysql.com/articles/dotnet/">Exploring MySQL in the Microsoft .NET Environment</a> is an article
|
||||
by Mr. Venu who is a MySQL AB developer.
|
||||
by Mr. Venu who is a MySQL AB developer.</li>
|
||||
|
||||
<li>Other projects which have created a .NET Data provider for MySQL in C#
|
||||
<li>There is a good alternative to the provider in Mono:
|
||||
<ul>
|
||||
<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#
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> from ByteFX
|
||||
is a MySQL Managed provider written in 100% C#,
|
||||
does not require a client library, and works on Microsoft .NET and Mono. You
|
||||
need at least Mono 0.18 and MySQLNet 0.65 for it to work on Mono.</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li>Testing for Mono's Mono.Data.MySql and ByteFX's ByteFX.Data.MySQLClient is below...</li>
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
** Current Status
|
||||
|
||||
<ul>
|
||||
<li>can connect
|
||||
@@ -48,7 +53,7 @@
|
||||
can be modified with a text editor.
|
||||
</ul>
|
||||
|
||||
* Action plan
|
||||
** Action plan
|
||||
|
||||
The current plan to work on the MySQL data provider:
|
||||
|
||||
@@ -64,3 +69,202 @@ The current plan to work on the MySQL data provider:
|
||||
|
||||
<li>Get the provider to work like other data providers
|
||||
</ul>
|
||||
|
||||
** Testing for Mono's MySQL provider (Mono.Data.MySql)
|
||||
|
||||
<ul>
|
||||
<li>Have access to a MySQL database or download it from
|
||||
<ul>
|
||||
<li><a href="http://www.mysql.com/downloads/index.html">MySQL AB</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Take a look at MySqlTest.cs in mcs/class/Mono.Data.MySql/Test</li>
|
||||
|
||||
<li>Has a ConnectionString format:
|
||||
<pre>
|
||||
"Server=hostname;" +
|
||||
"Database=database;" +
|
||||
"User ID=username;" +
|
||||
"Password=password"
|
||||
(or)
|
||||
"host=hostname;" +
|
||||
"dbname=database;" +
|
||||
"user=username;" +
|
||||
"passwd=password"
|
||||
</pre>
|
||||
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using Mono.Data.MySql;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=test;" +
|
||||
"User ID=mysql;" +
|
||||
"Password=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new MySqlConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
// such as,
|
||||
// CREATE TABLE employee (
|
||||
// firstname varchar(32),
|
||||
// lastname varchar(32));
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
string LastName = reader["lastname"];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs \
|
||||
-r System.Data.dll \
|
||||
-r Mono.Data.MySql.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll \
|
||||
-r Mono.Data.MySql.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Testing for MySQLNet provider (ByteFX.Data.MySQLClient)
|
||||
|
||||
<ul>
|
||||
<li>Have access to a MySQL database or download it from
|
||||
<ul>
|
||||
<li><a href="http://www.mysql.com/downloads/index.html">MySQL AB</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>MySQLNet can be gotten from <a href="http://sourceforge.net/projects/mysqlnet/">here</a> and the
|
||||
binary assembly ByteFX.Data.dll needs to be installed
|
||||
in the same place as the mono class libraries.</li>
|
||||
|
||||
<li>MySQLNet requires <a href="http://www.icsharpcode.net/OpenSource/SharpZipLib/default.asp">SharpZipLib</a> which is
|
||||
a Zip Library written in 100% C#. This is used for compression/decompression of data
|
||||
sent/received over the network. The SharpZipLib binary assembly SharpZipLib.dll should
|
||||
be installed in the same place as the mono class libraries.</li>
|
||||
|
||||
<li>Has a ConnectionString format:
|
||||
<pre>
|
||||
"Server=hostname;" +
|
||||
"Database=database;" +
|
||||
"User ID=username;" +
|
||||
"Password=password"
|
||||
</pre>
|
||||
</li>
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using ByteFX.Data.MySQLClient;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=test;" +
|
||||
"User ID=mysql;" +
|
||||
"Password=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new MySQLConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
// such as,
|
||||
// CREATE TABLE employee (
|
||||
// firstname varchar(32),
|
||||
// lastname varchar(32));
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
string LastName = reader["lastname"];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll \
|
||||
-r ByteFX.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll -r ByteFX.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -2,51 +2,174 @@
|
||||
<ul>
|
||||
<li>Exists in namespace System.Data.Odbc and assembly System.Data
|
||||
|
||||
<li>Works on Windows and Linux
|
||||
<li>Works on Windows and Linux. Should have no problems working on UNIX too.
|
||||
|
||||
<li>Works on Windows via the native Windows odbc32.dll
|
||||
|
||||
<li>Works on Linux via <a href="http://www.unixodbc.org/">unixODBC</a>
|
||||
<li>Works on Linux via:
|
||||
|
||||
<li>List of unixODBC <a href="http://www.unixodbc.org/drivers.html">drivers</a> and
|
||||
an alternative list
|
||||
<ul>
|
||||
<li><a href="http://www.unixodbc.org/">unixODBC</a> which has
|
||||
commercial support
|
||||
from <a href="http://www.easysoft.com/">Easysoft</a></li>
|
||||
|
||||
<li><a href="http://www.iodbc.org/">iODBC</a> which has
|
||||
a commercial support
|
||||
from <a href="http://oplweb.openlinksw.com:8080/download/">OpenLink Software</a></li>
|
||||
</ul>
|
||||
|
||||
<li>An alternative to unixODBC, but not tested with this
|
||||
provider is <a href="http://www.iodbc.org">iODBC</a>
|
||||
|
||||
<li>Another alternative to unixODBC, but not tested this provider is
|
||||
<a href="http://oplweb.openlinksw.com:8080/download/">OpenLink's</a>.
|
||||
<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>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.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)
|
||||
</ul>
|
||||
|
||||
<li>ODBC Provider created by Brian Ritchie.
|
||||
<li>ODBC Provider created by Brian Ritchie.</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
** Current Status
|
||||
|
||||
<ul>
|
||||
<li>Connect on Windows via native Windows odbc32.dll
|
||||
|
||||
<li>Connect on Linux via unixODBC's libodbc.so
|
||||
<li>Can Connect on:
|
||||
<ul>
|
||||
<li>Windows via native Windows odbc32.dll</a></li>
|
||||
<li>Linux via:
|
||||
<ul>
|
||||
<li>unixODBC's libodbc.so</li>
|
||||
<li>iODBC's libiodbc.so</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Various databases have been tested using their
|
||||
ODBC drivers: MySQL, Oracle, IBM DB2, and Microsoft SQL Server
|
||||
ODBC drivers: MySQL, PostgreSQL, Oracle, IBM DB2, and Microsoft SQL Server</li>
|
||||
|
||||
<li>Can execute non-query commands via ExecuteNonQuery of a OdbcCommand
|
||||
<li>Can execute non-query commands via ExecuteNonQuery of a OdbcCommand</li>
|
||||
|
||||
<li>Can execute aggreates and retrieve a single row single column result via
|
||||
ExecuteScalar of a OdbcCommand
|
||||
ExecuteScalar of a OdbcCommand</li>
|
||||
|
||||
<li>Can execute queries via ExecuteReader of a OdbcCommand and
|
||||
retrieve results using an OdbcDataReader.
|
||||
retrieve results using an OdbcDataReader</li>
|
||||
|
||||
<li>Can get a DataTable containing schema info via GetSchemaTable() in a OdbcDataReader
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
* Action Plan
|
||||
** Action Plan
|
||||
|
||||
<ul>
|
||||
<li>Create a Data Adapter to Fill data into a DataTable in a DataSet
|
||||
|
||||
<li>TODO
|
||||
<li>Fixing bugs
|
||||
|
||||
<li>Testing with other setups
|
||||
</ul>
|
||||
|
||||
** Testing ODBC provider
|
||||
|
||||
<p>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"
|
||||
</pre>
|
||||
</li>
|
||||
<li>Here is a ConnectionString format if you do not have DSN (have not
|
||||
gotten this to work):
|
||||
<pre>
|
||||
"DRIVER={SQL Server};SERVER=(local);UID=sa;PWD=;DATABASE=pubs"
|
||||
</pre>
|
||||
</li>
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.Odbc;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
// have an ODBC DSN setup named MYSQLDSN
|
||||
// that accesses a MySQL database via
|
||||
// MyODBC driver for ODBC with a
|
||||
// hostname of localhost and database test
|
||||
string connectionString =
|
||||
"DSN=MYSQLDSN;" +
|
||||
"UID=mysql;" +
|
||||
"PWD=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new OdbcConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
// such as,
|
||||
// CREATE TABLE employee (
|
||||
// firstname varchar(32),
|
||||
// lastname varchar(32));
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
string LastName = reader["lastname"];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1,53 +1,142 @@
|
||||
* OLE DB Provider
|
||||
|
||||
<ul>
|
||||
<li> Provides a OleDb-like provider for Mono
|
||||
using <a href="http://www.gnome-db.org/">GDA</a> as the data access layer.
|
||||
using <a href="http://www.gnome-db.org/">GDA</a> as the data access layer.</li>
|
||||
|
||||
<li> Exists in namespace System.Data.OleDb and assembly System.Data
|
||||
<li> Exists in namespace System.Data.OleDb and assembly System.Data</li>
|
||||
|
||||
<li>Created by Rodrigo Moya
|
||||
<li>Created by Rodrigo Moya</li>
|
||||
|
||||
<li>LibGDA has providers for:
|
||||
<li>LibGDA has providers for:</li>
|
||||
<ul>
|
||||
<li><a href="http://www.mysql.com/">MySQL</a>
|
||||
<li><a href="http://www.postgresql.org/">PostgreSQL</a>
|
||||
<li>XML
|
||||
<li>ODBC (via <a href="http://www.unixodbc.org/">unixODBC</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.mysql.com/">MySQL</a></li>
|
||||
<li><a href="http://www.postgresql.org/">PostgreSQL</a></li>
|
||||
<li>XML</li>
|
||||
<li>ODBC (via <a href="http://www.unixodbc.org/">unixODBC</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> and
|
||||
<a href="http://www.microsoft.com/sql/default.asp">Microsoft SQL Server</a> (
|
||||
via <a href="http://www.freetds.org/">FreeTDS</a>)
|
||||
<li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a>
|
||||
<li><a href="http://www.hwaci.com/sw/sqlite/download.html">SQL Lite</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>)
|
||||
via <a href="http://www.freetds.org/">FreeTDS</a>)</li>
|
||||
<li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a></li>
|
||||
<li><a href="http://www.hwaci.com/sw/sqlite/download.html">SQL Lite</a></li>
|
||||
<li><a href="http://www.microsoft.com/office/access/default.asp">MS Access</a></li>
|
||||
(via <a href="http://mdbtools.sourceforge.net/">MDB Tools</a>)</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
** Current Status
|
||||
<ul>
|
||||
<li>The OleDb provider is working with libgda (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.
|
||||
PostgreSQL database via libgda via the C-Sharp bindings to libgda.</li>
|
||||
|
||||
<li>Basic
|
||||
functionality (execution of commands, data retrieval, transactions, etc) are
|
||||
now working.
|
||||
now working.</li>
|
||||
|
||||
<li>An inital implementation of GetSchemaTable() for
|
||||
the OleDbDataReader has been checked into cvs. GetSchemaTable() isn't correct for OleDb,
|
||||
but the foundation is there.
|
||||
but the foundation is there.</li>
|
||||
</ul>
|
||||
|
||||
* Action Plan
|
||||
** Action Plan
|
||||
<ul>
|
||||
<li>Current focus is on filling up the missing pieces (Data adapters
|
||||
mainly) and schema support.
|
||||
mainly) and schema support.</li>
|
||||
|
||||
<li>We need help building libgda on Windows though. libgda
|
||||
builds find on linux though.
|
||||
builds find on linux though.</li>
|
||||
|
||||
<li>Need to make the OleDb provider compatible with the OleDb provider in Microsoft .NET
|
||||
<li>Need to make the OleDb provider compatible with the OleDb provider in Microsoft .NET</li>
|
||||
</ul>
|
||||
|
||||
** Testing OleDb with libgda's PostgreSQL provider
|
||||
|
||||
<ul>
|
||||
<li>Requires a working mono and mcs</li>
|
||||
<li>Requires Linux because the OleDb provider uses libgda and libgda only
|
||||
works on Linux.</li>
|
||||
<li>Connection String format: "Provider=providerName;...". providerName is the
|
||||
name of the Provider you use, such as, PostgreSQL, MySQL, etc. The elipsis ...
|
||||
means that the connection parameters are dependent upon the provider being used and
|
||||
are passed to libgda for connecting. Such paramters, can be: Database, User ID, Password,
|
||||
Server, etc...</li>
|
||||
<li>See the test TestOleDb.cs found at mcs/class/System.Data/System.Data.OleDb</li>
|
||||
<li>C# Example for Mono's System.Data.OleDb:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
// there is a libgda PostgreSQL provider
|
||||
string connectionString =
|
||||
"Provider=PostgreSQL;" +
|
||||
"Addr=127.0.0.1;" +
|
||||
"Database=rodrigo";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new OleDbConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
// such as,
|
||||
// CREATE TABLE employee (
|
||||
// firstname varchar(32),
|
||||
// lastname varchar(32));
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
string LastName = reader["lastname"];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
+96
-2
@@ -1,4 +1,5 @@
|
||||
* Oracle Data Provider
|
||||
|
||||
<ul>
|
||||
<li>Exists in namespace System.Data.OracleClient and assembly System.Data.OracleClient</li>
|
||||
|
||||
@@ -7,10 +8,14 @@
|
||||
<li>Works with Oracle 8i</li>
|
||||
|
||||
<li>More information about Oracle can be found at <a href="http://www.oracle.com/"/>here</a></li>
|
||||
|
||||
<li>Created by Daniel Morgan.</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
** Current Status
|
||||
|
||||
<ul>
|
||||
<li>OracleConnection can connect to an Oracle 8i database on
|
||||
@@ -30,7 +35,7 @@
|
||||
|
||||
</ul>
|
||||
|
||||
* Action Plan
|
||||
** Action Plan
|
||||
|
||||
<ul>
|
||||
<li>Get the makefile for the Borland C++ compiler to work
|
||||
@@ -50,3 +55,92 @@
|
||||
Marshalling in C# to the oci shared library (oci.dll on Windows)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Testing Mono.Data.OracleClient
|
||||
|
||||
<ul>
|
||||
<li>Have a working mono and mcs</li>
|
||||
|
||||
<li>Have access to an Oracle 8i database or download it from
|
||||
<a href="http://www.oracle.com/">Oracle</a>. Registration to the
|
||||
Oracle Technology Network is free. If installing on Linux, I suggest you
|
||||
do a lot of searching to see how others installed Oracle on Linux.</li>
|
||||
|
||||
<li>Make sure Mono.Data.OracleClient.dll assembly is built, if not, go
|
||||
into Mono.Data.OracleClient and do a make -f makefile.gnu (on Linux) or
|
||||
../../nant/NAnt.exe (on Cygwin).</li>
|
||||
|
||||
<li>The OCI Glue Library Mono.Data.OracleClient.ociglue.dll will need to be
|
||||
created as well. Has only been tested with lc (Microsoft Visual C++ command-line compiler).
|
||||
There is a make file for Microsoft C++ and Borland C++. I'm sure it wouldn't be hard
|
||||
to create a makefile for gcc if installing on Linux.</li>
|
||||
|
||||
<li>Take a look at TestOracleClient.cs found at mcs/class/System.Data.OracleClient/Test</li>
|
||||
|
||||
<li>Has a connection string format:
|
||||
<pre>
|
||||
"Data Source=tnsname;User ID=userid;Password=password"
|
||||
</pre>
|
||||
</li>
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.OracleClient;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Data Source=testdb;" +
|
||||
"User ID=scott;" +
|
||||
"Password=tiger;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new OracleConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"insert into scott.emp " +
|
||||
"(empno, ename, job, sal, deptno) " +
|
||||
"values(123," +
|
||||
"'Don Smith'," +
|
||||
"'Cook'," +
|
||||
"23021," +
|
||||
"20)";
|
||||
dbcmd.ConnectionString = sql;
|
||||
dbcmd.ExecuteNonQuery();
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll \
|
||||
-r System.Data.OracleClient.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll -r System.Data.OracleClient.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
+194
-214
@@ -1,16 +1,27 @@
|
||||
* PostgreSQL Data Provider
|
||||
|
||||
<ul>
|
||||
<li>Exists in namespace Mono.Data.PostgreSql and assembly Mono.Data.PostgreSql
|
||||
<li>Exists in namespace Mono.Data.PostgreSql and assembly Mono.Data.PostgreSql</li>
|
||||
|
||||
<li>Is a Mono Data Provider for the <a href="http://www.postgresql.org/">PostgreSQL</a>
|
||||
client/server database management system.
|
||||
client/server database management system.</li>
|
||||
|
||||
<li>Written in C# and has C# bindings to the PostgreSQL C Client library pq.dll on Windows
|
||||
and libpq.so on Linux.
|
||||
and libpq.so on Linux.</li>
|
||||
|
||||
<li>Alternative to the PostgreSQL provider in Mono:
|
||||
<ul>
|
||||
<li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a>
|
||||
is a Managed PostgreSQL provider written in 100% C#, does not require a client library,
|
||||
and works on Microsoft .NET and Mono.
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>See Testing for both Mono's Mono.Data.PostgreSqlClient and Npgsql.</li>
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
** Current Status
|
||||
|
||||
<ul>
|
||||
<li>We are able to do simple CREATE TABLE, DROP TABLE, UPDATE, INSERT, and
|
||||
@@ -70,12 +81,23 @@
|
||||
See the test mcs/class/System.Data/Test/TestSqlDataAdapter.cs to see it in action.
|
||||
</ul>
|
||||
|
||||
* Testing the PostgreSQL Provider
|
||||
** Action Plan
|
||||
|
||||
<p>More testing and fixing bugs...
|
||||
|
||||
<p>Eventually replace the PostgreSQL data provider in Mono
|
||||
with <a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a>.
|
||||
Npgsql is a .Net Data Provider for PostgreSQL which implements
|
||||
the <a href="http://developer.postgresql.org/docs/postgres/protocol.html">PostgreSQL Frontend/Backend Protocol</a>.
|
||||
Npgsql is implemented in 100% C#. This provider was created by Francisco Figueiredo jr.
|
||||
and has many programmers developing the provider.
|
||||
|
||||
** Testing Mono's Mono.Data.PostgreSqlClient
|
||||
|
||||
<ul>
|
||||
* <p>In order to test Mono.Data.PostgreSqlClient, you will need to have
|
||||
access to a remote PostgreSQL DBMS, or you will have to install
|
||||
one locally. PostgreSQL was first ADO.NET provider created in Mono.
|
||||
one locally. PostgreSQL was the first ADO.NET provider created in Mono.
|
||||
|
||||
<p>Why use PostgreSQL? Because it is free software, has a client
|
||||
library that is easy to use, PostgreSQL is easy to install on
|
||||
@@ -94,7 +116,9 @@
|
||||
user "postgres".
|
||||
|
||||
<pre>
|
||||
"host=localhost;dbname=test;user=postgres"
|
||||
"Server=localhost;Database=test;User ID=postgres;Password=fun2db"
|
||||
(or)
|
||||
"host=localhost;dbname=test;user=postgres;password=fun2db"
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
@@ -179,9 +203,15 @@ create user postgres with password 'fun2db';
|
||||
* <p>Important notes from this file are:
|
||||
|
||||
<ul>
|
||||
<p><b>2.</b> - Install the latest <a href="http://www.neuro.gatech.edu/users/cwilson/cygutils/OBSOLETE/V1.1/cygipc/index.html">CygIPC</a> package.
|
||||
<p><b>2.</b> - Install the latest <a href="http://www.neuro.gatech.edu/users/cwilson/cygutils/cygipc/index.html">CygIPC</a> package.
|
||||
Cygwin includes a utility bunzip2 which can be used to unzip it. Now, change to
|
||||
the root directory by
|
||||
typing "cd /" then
|
||||
you can use "tar xvf cygipc.xxx.tar" to untar it
|
||||
in the root directory in cygwin.
|
||||
|
||||
<p>The cygipc package contains the ipc-daemon you will need
|
||||
<p>The cygipc package contains the support to run ipc-daemon
|
||||
that you will need
|
||||
to run before you can
|
||||
run the PostgreSQL DBMS Server daemon (postmaster) or run
|
||||
initdb which initializes the PostgreSQL database.
|
||||
@@ -267,34 +297,9 @@ create user postgres with password 'fun2db';
|
||||
</ul>
|
||||
|
||||
<p>In the path mcs/class/System.Data/Test
|
||||
there is a PostgreSQL test program named
|
||||
there is a test for Mono.Data.PostgreSqlClient named
|
||||
PostgreTest.cs. Thanks goes to Gonzalo for creating the original
|
||||
PostgreSQL test.
|
||||
|
||||
<p>To use it to test System.Data, you
|
||||
modify the file to your PostgreSQL database
|
||||
connection requirements:
|
||||
|
||||
<p>
|
||||
<ul>
|
||||
<li><b>dbname</b> database, ie., test</li>
|
||||
<li><b>host</b> hostname of the PostgreSQL DBMS Server, ie., localhost</li>
|
||||
<li><b>user</b> username, ie., someuser</li>
|
||||
<li><b>password</b> password, ie., mypass1234</li>
|
||||
</ul>
|
||||
|
||||
<p>The connection string is in OLE-DB connection string format. Internally,
|
||||
SqlConnection converts this to the PostgreSQL connection string format.
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
OLE-DB: "host=localhost;dbname=test;user=joe;password=smoe"
|
||||
PostgreSQL: "host=localhost dbname=test user=joe password=smoe"
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Note that OLE-DB includes the semicolons while PostgreSQL's connection
|
||||
string does not.
|
||||
|
||||
<p>
|
||||
To compile the PostgresTest.cs program, do:
|
||||
@@ -310,7 +315,7 @@ PostgreSQL: "host=localhost dbname=test user=joe password=smoe"
|
||||
to PgSqlConnection, then you need to run mcs like:
|
||||
|
||||
<pre>
|
||||
mono f:/cygwin/home/DanielMorgan/mono/install/bin/mcs.exe \
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
PostgresTest.cs \
|
||||
-r System.Data.dll \
|
||||
-r Mono.Data.PostgreSqlClient.dll
|
||||
@@ -328,185 +333,160 @@ mint PostgresTest.exe
|
||||
To run using mono, do:
|
||||
<pre>
|
||||
mono PostgresTest.exe
|
||||
</pre>
|
||||
|
||||
<p>C# Example for Mono.Data.PostgreSqlClient:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using Mono.Data.PostgreSqlClient;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=test;" +
|
||||
"User ID=postgres;" +
|
||||
"Password=fun2db;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new PgConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
// such as,
|
||||
// CREATE TABLE employee (
|
||||
// firstname varchar(32),
|
||||
// lastname varchar(32));
|
||||
string sql =
|
||||
"SELECT firstname, lastname" +
|
||||
"FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
string LastName = reader["lastname"];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>Below, I show how the output from PostgresTest. I have omitted a lot
|
||||
of the meta data for the columns except two columns. The classes
|
||||
used were from Mono.Data.PostgreSqlClient and were used to connect to a
|
||||
PostgreSQL database and retrieve data.
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
|
||||
danmorg@DANPC ~/mono/mcs/class/System.Data/Test
|
||||
$ mcs PostgresTest.cs -r System.Data.dll
|
||||
|
||||
danmorg@DANPC ~/mono/mcs/class/System.Data/Test
|
||||
$ mono PostgresTest.exe
|
||||
Postgres provider specific tests...
|
||||
|
||||
Drop table:
|
||||
Error (don't worry about this one)SqlError:PGRES_FATAL_ERROR ERROR:
|
||||
table "mono_postgres_test" does not exist
|
||||
<Stack Trace>
|
||||
|
||||
Create table with all supported types:
|
||||
OK
|
||||
Insert values for all known types:
|
||||
OK
|
||||
Update values:
|
||||
OK
|
||||
Insert values for all known types:
|
||||
OK
|
||||
Aggregate: count(*)
|
||||
Agg Result: 2
|
||||
Aggregate: min(text_value)
|
||||
Agg Result: This is a text
|
||||
Aggregate: max(int4_value)
|
||||
Agg Result: 1048000
|
||||
Aggregate: sum(int4_value)
|
||||
Agg Result: 1048003
|
||||
Select values from the database:
|
||||
Result is from a SELECT SQL Query. Records Affected: -1
|
||||
Result Set 1...
|
||||
Total Columns: 28
|
||||
ColumnName = boolean_value
|
||||
ColumnOrdinal = 1
|
||||
ColumnSize = 1
|
||||
NumericPrecision = 0
|
||||
NumericScale = 0
|
||||
IsUnique = False
|
||||
IsKey =
|
||||
BaseCatalogName =
|
||||
BaseColumnName = boolean_value
|
||||
BaseSchemaName =
|
||||
BaseTableName =
|
||||
DataType = System.Boolean
|
||||
AllowDBNull = False
|
||||
ProviderType = 16
|
||||
IsAliased = False
|
||||
IsExpression = False
|
||||
IsIdentity = False
|
||||
IsAutoIncrement = False
|
||||
IsRowVersion = False
|
||||
IsHidden = False
|
||||
IsLong = False
|
||||
IsReadOnly = False
|
||||
|
||||
...
|
||||
|
||||
ColumnName = null_timestamp_value
|
||||
ColumnOrdinal = 28
|
||||
ColumnSize = 8
|
||||
NumericPrecision = 0
|
||||
NumericScale = 0
|
||||
IsUnique = False
|
||||
IsKey =
|
||||
BaseCatalogName =
|
||||
BaseColumnName = null_timestamp_value
|
||||
BaseSchemaName =
|
||||
BaseTableName =
|
||||
DataType = System.DateTime
|
||||
AllowDBNull = False
|
||||
ProviderType = 1184
|
||||
IsAliased = False
|
||||
IsExpression = False
|
||||
IsIdentity = False
|
||||
IsAutoIncrement = False
|
||||
IsRowVersion = False
|
||||
IsHidden = False
|
||||
IsLong = False
|
||||
IsReadOnly = False
|
||||
|
||||
Gonna do a Read() now...
|
||||
Row 0:
|
||||
Col 0: boolean_value: False
|
||||
Col 1: int2_value: 5
|
||||
Col 2: int4_value: 3
|
||||
Col 3: bigint_value: 9
|
||||
Col 4: float_value: 3.141590
|
||||
Col 5: double_value: 3.14159
|
||||
Col 6: numeric_value: 123456789012.345
|
||||
Col 7: char_value: Mono.Data!
|
||||
Col 8: varchar_value: It was not me!
|
||||
Col 9: text_value: We got data!
|
||||
Col 10: point_value: (1,0)
|
||||
Col 11: time_value: 01/01/1 21:13:14
|
||||
Col 12: date_value: 02/29/2000 00:00:00
|
||||
Col 13: timestamp_value: 02/29/2004 14:00:11
|
||||
Col 14: null_boolean_value is NULL
|
||||
Col 15: null_int2_value is NULL
|
||||
Col 16: null_int4_value is NULL
|
||||
Col 17: null_bigint_value is NULL
|
||||
Col 18: null_float_value is NULL
|
||||
Col 19: null_double_value is NULL
|
||||
Col 20: null_numeric_value is NULL
|
||||
Col 21: null_char_value is NULL
|
||||
Col 22: null_varchar_value is NULL
|
||||
Col 23: null_text_value is NULL
|
||||
Col 24: null_point_value is NULL
|
||||
Col 25: null_time_value is NULL
|
||||
Col 26: null_date_value is NULL
|
||||
Col 27: null_timestamp_value is NULL
|
||||
Row 1:
|
||||
Col 0: boolean_value: True
|
||||
Col 1: int2_value: -22
|
||||
Col 2: int4_value: 1048000
|
||||
Col 3: bigint_value: 123456789012345
|
||||
Col 4: float_value: 3.141590
|
||||
Col 5: double_value: 3.14159
|
||||
Col 6: numeric_value: 123456789012.345
|
||||
Col 7: char_value: This is a char
|
||||
Col 8: varchar_value: This is a varchar
|
||||
Col 9: text_value: This is a text
|
||||
Col 10: point_value: (1,0)
|
||||
Col 11: time_value: 01/01/1 21:13:14
|
||||
Col 12: date_value: 02/29/2000 00:00:00
|
||||
Col 13: timestamp_value: 02/29/2004 14:00:11
|
||||
Col 14: null_boolean_value is NULL
|
||||
Col 15: null_int2_value is NULL
|
||||
Col 16: null_int4_value is NULL
|
||||
Col 17: null_bigint_value is NULL
|
||||
Col 18: null_float_value is NULL
|
||||
Col 19: null_double_value is NULL
|
||||
Col 20: null_numeric_value is NULL
|
||||
Col 21: null_char_value is NULL
|
||||
Col 22: null_varchar_value is NULL
|
||||
Col 23: null_text_value is NULL
|
||||
Col 24: null_point_value is NULL
|
||||
Col 25: null_time_value is NULL
|
||||
Col 26: null_date_value is NULL
|
||||
Col 27: null_timestamp_value is NULL
|
||||
Total Rows Retrieved: 2
|
||||
Total Result sets: 1
|
||||
Call ExecuteReader with a SQL Command.
|
||||
(Not INSERT,UPDATE,DELETE
|
||||
).
|
||||
Result is from a SQL Command not (INSERT,UPDATE,DELETE).
|
||||
Records Affected: -1
|
||||
Total Result sets: 0
|
||||
Call ExecuteReader with a SQL Command.
|
||||
(Is INSERT,UPDATE,DELETE)
|
||||
.
|
||||
Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: 1
|
||||
Total Result sets: 0
|
||||
Calling stored procedure version()
|
||||
Result: PostgreSQL 7.2.1 on i686-pc-cygwin, compiled by GCC 2.95.3-5
|
||||
Database Server Version: PostgreSQL 7.2.1 on i686-pc-cygwin,
|
||||
compiled by GCC 2.9
|
||||
5.3-5
|
||||
Clean up...
|
||||
Drop table...
|
||||
OK
|
||||
RESULT: 0
|
||||
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll \
|
||||
-r Mono.Data.PostgreSqlClient.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll -r Mono.Data.PostgreSqlClient.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
* Action Plan
|
||||
** Testing Npgsql
|
||||
|
||||
<p>Eventually replace the PostgreSQL data provider in Mono
|
||||
with <a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a>.
|
||||
Npgsql is a .Net Data Provider for PostgreSQL which implements
|
||||
the <a href="http://developer.postgresql.org/docs/postgres/protocol.html">PostgreSQL Frontend/Backend Protocol</a>.
|
||||
Npgsql is implemented in 100% C#. This provider was created by Francisco Figueiredo jr.
|
||||
and has many programmers developing the provider.
|
||||
<ul>
|
||||
<li>Have a working mono and mcs</li>
|
||||
|
||||
<li>Get <a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a>
|
||||
and make sure the binary assembly Npgsql.dll is installed in the same place that the
|
||||
mono class libraries are located.
|
||||
|
||||
<li>Read the Testing notes for Mono.Data.PostgreSqlClient too
|
||||
|
||||
<li>C# Example for Npgsql:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using Npgsql;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=test;" +
|
||||
"User ID=postgres;" +
|
||||
"Password=fun2db;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new NpgsqlConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
// such as,
|
||||
// CREATE TABLE employee (
|
||||
// firstname varchar(32),
|
||||
// lastname varchar(32));
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
string LastName = reader["lastname"];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll \
|
||||
-r Npgsql.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll -r Npgsql.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
+112
-23
@@ -1,58 +1,147 @@
|
||||
* Microsoft SQL Server Provider
|
||||
|
||||
<ul>
|
||||
<li>ADO.NET Provider for Microsoft SQL Server 7/2000 databases
|
||||
<li>ADO.NET Provider for Microsoft SQL Server 7/2000 databases</li>
|
||||
|
||||
<li>Exists in namespace System.Data.SqlClient and assembly System.Data
|
||||
<li>Exists in namespace System.Data.SqlClient and assembly System.Data</li>
|
||||
|
||||
<li>Created by Tim Coleman
|
||||
<li>Created by Tim Coleman</li>
|
||||
|
||||
<li>Used the <a href="http://www.freetds.org/">FreeTDS</a> and
|
||||
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.
|
||||
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.</li>
|
||||
|
||||
<li>Implemented in 100% C#
|
||||
<li>Implemented in 100% C#</li>
|
||||
|
||||
<li>Is similar to the Mono.Data.TdsClient and Mono.Data.SybaseClient providers.
|
||||
<li>Is similar to the Mono.Data.TdsClient and Mono.Data.SybaseClient providers.</li>
|
||||
|
||||
<li>Requires the assembly Mono.Data.Tds.dll which implements the TDS protocol in 100% C#.</li>
|
||||
|
||||
<li>Uses TDS Protocol Version 7.0</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
|
||||
|
||||
** Current Status
|
||||
|
||||
|
||||
<ul>
|
||||
<li>Able to connect to Microsoft SQL Server 7/2000 databases
|
||||
<li>Able to connect to Microsoft SQL Server 7/2000 databases</li>
|
||||
|
||||
<li>Connection pooling works.
|
||||
<li>Connection pooling works.</li>
|
||||
|
||||
<li>Stored Procedures work
|
||||
<li>Stored Procedures work</li>
|
||||
|
||||
<li>Parameters work.
|
||||
<li>Parameters work.</li>
|
||||
|
||||
<li>Prepare works.
|
||||
<li>Prepare works.</li>
|
||||
|
||||
<li>SQL commands can be executed
|
||||
via ExecuteNonQuery() of a SqlCommand.
|
||||
via ExecuteNonQuery() of a SqlCommand.</li>
|
||||
|
||||
<li>SQL aggregates can be executed and a single row and single column
|
||||
result can be retrieved via ExecuteScalar() of a SqlCommand
|
||||
result can be retrieved via ExecuteScalar() of a SqlCommand</li>
|
||||
|
||||
<li>SQL queries can be executed via ExecuteReader() and results
|
||||
can be retrieved via SqlDataReader.
|
||||
can be retrieved via SqlDataReader.</li>
|
||||
|
||||
<li>a DataTable with schema info about a result can be gotten via GetSchemaTable()
|
||||
in a SqlDataReader
|
||||
in a SqlDataReader</li>
|
||||
|
||||
<li>XML can be read via ExecuteXmlReader in a SqlCommand.
|
||||
<li>XML can be read via ExecuteXmlReader in a SqlCommand.</li>
|
||||
|
||||
<li>Data can be filled in a DataTable in a DataSet via a SqlDataAdapter
|
||||
<li>Data can be filled in a DataTable in a DataSet via a SqlDataAdapter</li>
|
||||
|
||||
<li>Uses TDS Protocol Version 7.0
|
||||
<li>Uses TDS Protocol Version 7.0</li>
|
||||
|
||||
<li><a href="http://www.go-mono.com/tds-providers.html">Design of the Microsoft SQL Server, Sybase, and TDS Providers in Mono</a>
|
||||
<li><a href="http://www.go-mono.com/tds-providers.html">Design of the Microsoft SQL Server, Sybase, and TDS Providers in Mono</a></li>
|
||||
</ul>
|
||||
|
||||
* Action plan
|
||||
** Action plan
|
||||
|
||||
<ul>
|
||||
<li>Connection timeouts is being developed now.
|
||||
|
||||
<li>TODO
|
||||
<li>Needs more testing...
|
||||
|
||||
</ul>
|
||||
|
||||
** Testing
|
||||
|
||||
<ul>
|
||||
<li>Have a working mono and mcs installed</li>
|
||||
|
||||
<li>Have access to a Microsoft SQL Server database
|
||||
or either download it:
|
||||
<ul>
|
||||
<li><a href="http://www.microsoft.com/sql/default.asp">Microsoft SQL Server</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient
|
||||
named SqlTest.cs and you could use this as a basis for your test.</li>
|
||||
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=pubs;" +
|
||||
"User ID=sa;" +
|
||||
"Password=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new SqlConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"SELECT fname, lname " +
|
||||
"FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["fname"];
|
||||
string LastName = reader["lname"];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs -r System.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
+93
-9
@@ -1,28 +1,112 @@
|
||||
* SQL Lite Data Provider
|
||||
|
||||
<ul>
|
||||
<li>Exists in namespace and assembly Mono.Data.SqliteClient
|
||||
<li>Exists in namespace and assembly Mono.Data.SqliteClient</li>
|
||||
|
||||
<li>Created by Vladimir Vukicevic
|
||||
<li>Created by Vladimir Vukicevic</li>
|
||||
|
||||
<li><a href"http://www.hwaci.com/sw/sqlite/download.html">SQL Lite</a>
|
||||
binaries exist for Linux and Windows. sqlite.dll on Windows
|
||||
and sqlite.so on Linux.
|
||||
and sqlite.so on Linux.</li>
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
** Current Status
|
||||
|
||||
<ul>
|
||||
<li>Able to connect, execute commands, and retrieve data...
|
||||
<li>Able to connect, execute commands, and retrieve data...</li>
|
||||
|
||||
<li>Works in mPhoto
|
||||
<li>Works in mPhoto by providing access to a SQL Lite database to store images.</li>
|
||||
</ul>
|
||||
|
||||
* Action Plan
|
||||
** Action Plan
|
||||
|
||||
<ul>
|
||||
<li>Create a DataAdapter for SQL Lite named SqliteDataAdapter that can be used to
|
||||
Fill a DataTable in a DataSet
|
||||
Fill a DataTable in a DataSet</li>
|
||||
|
||||
<li>TODO
|
||||
<li>Get the method GetSchemaTable() in class SqliteDataReader to return a DataTable
|
||||
that works</li>
|
||||
</ul>
|
||||
|
||||
** Testing
|
||||
|
||||
<ul>
|
||||
<li>Have a working mcs and mono</li>
|
||||
<li>Make sure Mono.Data.SqliteClient.dll was built and is installed
|
||||
in the same place as the mono class libraries.</li>
|
||||
<li>If you do not have <a href"http://www.hwaci.com/sw/sqlite/download.html">SQL Lite</a>,
|
||||
download it. There are binaries for Windows and Linux.</li>
|
||||
<li>There is a test named SqliteTest.cs found at mcs/class/Mono.Data.SqliteTest/Test</li>
|
||||
<li>Has a connection string format of "URI=file:some/path". For example,
|
||||
the connection string "URI=file:SqliteTest.db" will use the database file
|
||||
named SqliteTest.db, if it does not exist, the file will be created.</li>
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using Mono.Data.SqliteClient;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString = "URI=file:SqliteTest.db";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new MySQLConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
// such as,
|
||||
// CREATE TABLE employee (
|
||||
// firstname varchar(32),
|
||||
// lastname varchar(32));
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader[0];
|
||||
string LastName = reader[1];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll \
|
||||
-r Mono.Data.SqliteClient.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll \
|
||||
-r Mono.Data.SqliteClient.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
+103
-17
@@ -1,48 +1,134 @@
|
||||
* Sybase Data Provider
|
||||
|
||||
<ul>
|
||||
<li>ADO.NET Provider for Sybase SQL Server databases
|
||||
<li>ADO.NET Provider for Sybase SQL Server databases</li>
|
||||
|
||||
<li>Exists in namespace Mono.Data.SybaseClient and assembly Mono.Data.SybaseClient
|
||||
<li>Exists in namespace Mono.Data.SybaseClient and assembly Mono.Data.SybaseClient</li>
|
||||
|
||||
<li>Created by Tim Coleman
|
||||
<li>Created by Tim Coleman</li>
|
||||
|
||||
<li>Used the <a href="http://www.freetds.org/">FreeTDS</a> and
|
||||
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.
|
||||
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.</li>
|
||||
|
||||
<li>Implemented in 100% C#
|
||||
<li>Implemented in 100% C#</li>
|
||||
|
||||
<li>Is similar to the Mono.Data.TdsClient and System.Data.SqlClient providers.
|
||||
<li>Is similar to the Mono.Data.TdsClient and System.Data.SqlClient providers.</li>
|
||||
|
||||
<li>Uses TDS Protocol Version 5.0
|
||||
<li>Requires the assembly Mono.Data.Tds.dll which implements the TDS protocol in 100% C#.</li>
|
||||
|
||||
<li><a href="http://www.go-mono.com/tds-providers.html">Design of the Microsoft SQL Server, Sybase, and TDS Providers in Mono</a>
|
||||
<li>Uses TDS Protocol Version 5.0</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
** Current Status
|
||||
|
||||
<ul>
|
||||
<li>Able to connect to Sybase databases
|
||||
<li>Able to connect to Sybase databases</li>
|
||||
|
||||
<li>SQL commands can be executed
|
||||
via ExecuteNonQuery() of a SybaseCommand.
|
||||
via ExecuteNonQuery() of a SybaseCommand.</li>
|
||||
|
||||
<li>SQL aggregates can be executed and a single row and single column
|
||||
result can be retrieved via ExecuteScalar() of a SybaseCommand
|
||||
result can be retrieved via ExecuteScalar() of a SybaseCommand</li>
|
||||
|
||||
<li>SQL queries can be executed via ExecuteReader() and results
|
||||
can be retrieved via SybaseDataReader.
|
||||
can be retrieved via SybaseDataReader.</li>
|
||||
|
||||
<li>a DataTable with schema info about a result can be gotten via GetSchemaTable()
|
||||
in a SybaseDataReader
|
||||
in a SybaseDataReader</li>
|
||||
|
||||
<li>Data can be filled in a DataTable in a DataSet via a SybaseDataAdapter
|
||||
<li>Data can be filled in a DataTable in a DataSet via a SybaseDataAdapter</li>
|
||||
</ul>
|
||||
|
||||
* Action plan
|
||||
** Action plan
|
||||
|
||||
<ul>
|
||||
<li>Connection timeouts is being developed now.
|
||||
|
||||
<li>Needs more testing...
|
||||
|
||||
<li>TODO
|
||||
</ul>
|
||||
|
||||
** Testing
|
||||
|
||||
<ul>
|
||||
<li>Have a working mono and mcs installed</li>
|
||||
|
||||
<li>Have access to a Sybase database
|
||||
or either download it:
|
||||
<ul>
|
||||
<li><a href="http://www.sybase.com/downloads">Sybase</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient
|
||||
named SqlTest.cs and you could use this as a basis for your test.</li>
|
||||
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using Mono.Data.SybaseClient;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=pubs;" +
|
||||
"User ID=sa;" +
|
||||
"Password=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new SybaseConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"SELECT fname, lname " +
|
||||
"FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["fname"];
|
||||
string LastName = reader["lname"];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll \
|
||||
-r Mono.Data.SybaseClient.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll -r Mono.Data.SybaseClient.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
+105
-19
@@ -1,51 +1,137 @@
|
||||
* TDS Generic Provider
|
||||
|
||||
<ul>
|
||||
<li>ADO.NET Provider for older Sybase and Microsoft SQL Server databases
|
||||
<li>ADO.NET Provider for older Sybase and Microsoft SQL Server databases</li>
|
||||
|
||||
<li>Exists in namespace Mono.Data.TdsClient and assembly Mono.Data.TdsClient
|
||||
<li>Exists in namespace Mono.Data.TdsClient and assembly Mono.Data.TdsClient</li>
|
||||
|
||||
<li>Created by Tim Coleman
|
||||
<li>Created by Tim Coleman</li>
|
||||
|
||||
<li>Used the <a href="http://www.freetds.org/">FreeTDS</a> and
|
||||
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.
|
||||
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.</li>
|
||||
|
||||
<li>Implemented in 100% C#
|
||||
<li>Implemented in 100% C#</li>
|
||||
|
||||
<li>Is similar to the Mono.Data.SybaseClient and System.Data.SqlClient providers.
|
||||
<li>Is similar to the Mono.Data.SybaseClient and System.Data.SqlClient providers.</li>
|
||||
|
||||
<li>Uses TDS Protocol Version 4.2 by default
|
||||
<li>Requires the assembly Mono.Data.Tds.dll which implements the TDS protocol in 100% C#.</li>
|
||||
|
||||
<li><a href="http://www.go-mono.com/tds-providers.html">Design of the Microsoft SQL Server, Sybase, and TDS Providers in Mono</a>
|
||||
<li>Uses TDS Protocol Version 4.2 by default</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
** Current Status
|
||||
|
||||
|
||||
<ul>
|
||||
<li>Only builds on Windows currently due to mcs does not support modules and mcs
|
||||
has problems with code that is internal.
|
||||
has problems with code that is internal.</li>
|
||||
|
||||
<li>Able to connect to Microsoft SQL Server and Sybase databases
|
||||
<li>Able to connect to Microsoft SQL Server and Sybase databases</li>
|
||||
|
||||
<li>SQL commands can be executed
|
||||
via ExecuteNonQuery() of a TdsCommand.
|
||||
via ExecuteNonQuery() of a TdsCommand.</li>
|
||||
|
||||
<li>SQL aggregates can be executed and a single row and single column
|
||||
result can be retrieved via ExecuteScalar() of a TdsCommand
|
||||
result can be retrieved via ExecuteScalar() of a TdsCommand</li>
|
||||
|
||||
<li>SQL queries can be executed via ExecuteReader() and results
|
||||
can be retrieved via TdsDataReader.
|
||||
can be retrieved via TdsDataReader.</li>
|
||||
|
||||
<li>a DataTable with schema info about a result can be gotten via GetSchemaTable()
|
||||
in a TdsDataReader
|
||||
in a TdsDataReader</li>
|
||||
|
||||
<li>Data can be filled in a DataTable in a DataSet via a TdsDataAdapter
|
||||
<li>Data can be filled in a DataTable in a DataSet via a TdsDataAdapter</li>
|
||||
</ul>
|
||||
|
||||
* Action plan
|
||||
** Action plan
|
||||
|
||||
<ul>
|
||||
<li>Connection timeouts is being developed now.
|
||||
<li>Connection timeouts is being developed now.</li>
|
||||
|
||||
<li>TODO
|
||||
<li>TODO</li>
|
||||
</ul>
|
||||
|
||||
** Testing
|
||||
|
||||
<ul>
|
||||
<li>Have a working mono and mcs installed</li>
|
||||
|
||||
<li>Have access to a Sybase or Microsoft SQL Server database
|
||||
or either download it:
|
||||
<ul>
|
||||
<li><a href="http://www.microsoft.com/sql/default.asp">Microsoft SQL Server</a></li>
|
||||
<li><a href="http://www.sybase.com/downloads">Sybase</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient
|
||||
named SqlTest.cs and you could use this as a basis for your test.</li>
|
||||
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using Mono.Data.TdsClient;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=pubs;" +
|
||||
"User ID=sa;" +
|
||||
"Password=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new TdsConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"SELECT fname, lname " +
|
||||
"FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["fname"];
|
||||
string LastName = reader["lname"];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll \
|
||||
-r Mono.Data.TdsClient.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll -r Mono.Data.TdsClient.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
+2
-1
@@ -33,8 +33,8 @@
|
||||
1,Debugging,jit-debug.html,jit-debug.src
|
||||
0,Plans,plans.html,plans.src
|
||||
1,ADO.NET,ado-net.html,ado-net.src
|
||||
1,Crypto,crypto.html,crypto.src
|
||||
2,Firebird Interbase,firebird.html,firebird.src
|
||||
2,IBM DB2,ibmdb2.html,ibmdb2.src
|
||||
2,Microsft SQL Server,sqlclient.html,sqlclient.src
|
||||
2,MySQL,mysql.html,mysql.src
|
||||
2,ODBC,odbc.html,odbc.src
|
||||
@@ -44,6 +44,7 @@
|
||||
2,SQL Lite,sqlite.html,sqlite.src
|
||||
2,Sybase,sybase.html,sybase.src
|
||||
2,TDS Generic,tdsclient.html,tdsclient.src
|
||||
1,Crypto,crypto.html,crypto.src
|
||||
1,Java,java.html,java.src
|
||||
1,Windows.Forms,winforms.html,winforms.src
|
||||
0,Class Status,class-status.html,class-status.src,cm/cormissing.css,cm/cormissing.js
|
||||
|
||||
@@ -6,6 +6,7 @@ CORCOMPARE=../../../mcs/tools/corcompare
|
||||
OBJECTS= \
|
||||
deploy/ado-net.html \
|
||||
deploy/firebird.html \
|
||||
deploy/ibmdb2.html \
|
||||
deploy/mysql.html \
|
||||
deploy/odbc.html \
|
||||
deploy/oledb.html \
|
||||
|
||||
+21
-9
@@ -342,16 +342,28 @@ ption defaulting to true.
|
||||
.SH PROVIDERS
|
||||
.nf
|
||||
|
||||
PROVIDER NAME NAMESPACE ASSEMBLY
|
||||
PROVIDER NAME NAMESPACE ASSEMBLY
|
||||
|
||||
OleDb OLE DB System.Data.OleDb System.Data
|
||||
SqlClient MS SQL 7/2000 System.Data.SqlClient System.Data
|
||||
Odbc ODBC System.Data.Odbc System.Data
|
||||
MySql MySQL Mono.Data.MySql Mono.Data.MySql
|
||||
Sqlite SQL Lite Mono.Data.SqliteClient Mono.Data.SqliteClient
|
||||
Sybase Sybase Mono.Data.SybaseClient Mono.Data.SybaseClient
|
||||
Tds TDS Generic Mono.Data.TdsClient Mono.Data.TdsClient
|
||||
PostgreSql PostgreSQL Mono.Data.PostgreSqlClient Mono.Data.PostgreSqlClient
|
||||
Internal
|
||||
--------
|
||||
|
||||
OleDb OLE DB System.Data.OleDb System.Data
|
||||
SqlClient MS SQL 7/2000 System.Data.SqlClient System.Data
|
||||
Odbc ODBC System.Data.Odbc System.Data
|
||||
|
||||
External to System.Data
|
||||
----------------------
|
||||
MySql MySQL Mono.Data.MySql Mono.Data.MySql
|
||||
Sqlite SQL Lite Mono.Data.SqliteClient Mono.Data.SqliteClient
|
||||
Sybase Sybase Mono.Data.SybaseClient Mono.Data.SybaseClient
|
||||
Tds TDS Generic Mono.Data.TdsClient Mono.Data.TdsClient
|
||||
PostgreSql MonoPostgreSQL Mono.Data.PostgreSqlClient Mono.Data.PostgreSqlClient
|
||||
|
||||
External to Mono
|
||||
----------------
|
||||
|
||||
Npgsql PostgreSQL.NET Npgsql Npgsql
|
||||
MySQLNet ByteFX MySQL ByteFX.Data.MySQL ByteFX.Data
|
||||
|
||||
.fi
|
||||
.SH CONNECTION STRING SAMPLES
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
2003-01-16 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile.gnu: Add corlib target to just build that.
|
||||
|
||||
2003-01-14 Duncan Mak <[email protected]>
|
||||
|
||||
* ilasm/parser/ScannerAdapter.cs: Remove the cleanup method now that
|
||||
it's no longer in the interface.
|
||||
|
||||
2003-01-13 Duncan Mak <[email protected]>
|
||||
|
||||
* ilasm/parser/ScannerAdapter.cs: Implement the new cleanup method
|
||||
in the tokenizer. This fixes the build.
|
||||
|
||||
2003-01-10 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* README.building: New file.
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
2003-01-17 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* library.build: added System.Security to build, test and clean.
|
||||
There's no makefile.gnu yet for this assembly.
|
||||
|
||||
2003-01-16 Rodrigo Moya <[email protected]>
|
||||
|
||||
* makefile.gnu: added Mono.Data.DB2Client directory.
|
||||
|
||||
2003-01-08 Gaurav Vaish <gvaish_mono AT lycos.com>
|
||||
|
||||
* System.Web.Mobile : Added new directory
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
//
|
||||
// Author:
|
||||
// Chris J Breisch ([email protected])
|
||||
// Francesco Delfino ([email protected])
|
||||
//
|
||||
// (C) 2002 Chris J Breisch
|
||||
// 2002 [email protected]
|
||||
//
|
||||
|
||||
using System;
|
||||
@@ -13,29 +15,107 @@ namespace Microsoft.VisualBasic
|
||||
{
|
||||
sealed public class ErrObject {
|
||||
// Declarations
|
||||
int pHelpContext;
|
||||
int pLastDllError;
|
||||
int pNumber;
|
||||
int pErl;
|
||||
string pSource;
|
||||
string pHelpFile;
|
||||
string pDescription;
|
||||
System.Exception pException;
|
||||
// Constructors
|
||||
// Properties
|
||||
[MonoTODO]
|
||||
public System.Int32 HelpContext { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
|
||||
public System.Int32 HelpContext
|
||||
{
|
||||
get {
|
||||
return pHelpContext;
|
||||
}
|
||||
set {
|
||||
pHelpContext = value;
|
||||
}
|
||||
}
|
||||
[MonoTODO]
|
||||
public System.Int32 LastDllError { get { throw new NotImplementedException (); } }
|
||||
public System.Int32 LastDllError {
|
||||
get {
|
||||
return pLastDllError;
|
||||
}
|
||||
}
|
||||
[MonoTODO]
|
||||
public System.Int32 Number { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
|
||||
public System.Int32 Number {
|
||||
get {
|
||||
return pNumber;
|
||||
}
|
||||
set {
|
||||
pNumber = value;
|
||||
}
|
||||
}
|
||||
[MonoTODO]
|
||||
public System.Int32 Erl { get { throw new NotImplementedException (); } }
|
||||
public System.Int32 Erl {
|
||||
get {
|
||||
return pErl;
|
||||
}
|
||||
}
|
||||
[MonoTODO]
|
||||
public System.String Source { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
|
||||
public System.String Source {
|
||||
get {
|
||||
return pSource;
|
||||
}
|
||||
set {
|
||||
pSource = value;
|
||||
}
|
||||
}
|
||||
[MonoTODO]
|
||||
public System.String HelpFile { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
|
||||
public System.String HelpFile {
|
||||
get {
|
||||
return pHelpFile;
|
||||
}
|
||||
set {
|
||||
pHelpFile = value;
|
||||
}
|
||||
}
|
||||
[MonoTODO]
|
||||
public System.String Description { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
|
||||
public System.String Description {
|
||||
get {
|
||||
return pDescription;
|
||||
}
|
||||
set {
|
||||
pDescription = value;
|
||||
}
|
||||
}
|
||||
// Methods
|
||||
[MonoTODO("We should parse the exception object to obtain VB-like error code. Not a trivial task!")]
|
||||
internal void SetException (Exception ex)
|
||||
{
|
||||
if (pException != ex)
|
||||
{
|
||||
pNumber = 0xFFFF;
|
||||
pSource = ex.Source;
|
||||
pDescription = ex.Message + "\n" + ex.StackTrace;
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public System.Exception GetException () { throw new NotImplementedException (); }
|
||||
public System.Exception GetException ()
|
||||
{
|
||||
return pException;
|
||||
}
|
||||
[MonoTODO]
|
||||
public void Clear () { throw new NotImplementedException (); }
|
||||
public void Clear () {
|
||||
pHelpContext=0;
|
||||
pLastDllError=0;
|
||||
pNumber=0;
|
||||
pErl=0;
|
||||
pSource="";
|
||||
pHelpFile="";
|
||||
pDescription="";
|
||||
pException= null;
|
||||
}
|
||||
[MonoTODO]
|
||||
public void Raise (System.Int32 Number, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object Source, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object Description, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object HelpFile, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object HelpContext) { throw new NotImplementedException (); }
|
||||
public void Raise (System.Int32 Number, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object Source, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object Description, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object HelpFile, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object HelpContext)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
// Events
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -2,188 +2,421 @@
|
||||
// FileSystem.cs
|
||||
//
|
||||
// Author:
|
||||
// Chris J Breisch ([email protected])
|
||||
//
|
||||
// Daniel Campos ( [email protected] )
|
||||
//
|
||||
//
|
||||
// (C) 2002 Chris J Breisch
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
namespace Microsoft.VisualBasic
|
||||
{
|
||||
[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
|
||||
sealed public class FileSystem {
|
||||
// Declarations
|
||||
// Constructors
|
||||
// Properties
|
||||
// Methods
|
||||
[MonoTODO]
|
||||
public static void ChDir (System.String Path) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void ChDrive (System.Char Drive) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void ChDrive (System.String Drive) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String CurDir () { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String CurDir (System.Char Drive) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String Dir () { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String Dir (System.String Pathname, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.FileAttribute Attributes) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void MkDir (System.String Path) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void RmDir (System.String Path) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileCopy (System.String Source, System.String Destination) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.DateTime FileDateTime (System.String PathName) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.Int64 FileLen (System.String PathName) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static Microsoft.VisualBasic.FileAttribute GetAttr (System.String PathName) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Kill (System.String PathName) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void SetAttr (System.String PathName, Microsoft.VisualBasic.FileAttribute Attributes) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileOpen (System.Int32 FileNumber, System.String FileName, Microsoft.VisualBasic.OpenMode Mode, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] Microsoft.VisualBasic.OpenAccess Access, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] Microsoft.VisualBasic.OpenShare Share, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int32 RecordLength) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileClose (params System.Int32[] FileNumbers) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGetObject (System.Int32 FileNumber, ref System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.ValueType Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Array Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean ArrayIsDynamic, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Boolean Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Byte Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Int16 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Int32 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Int64 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Char Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Single Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Double Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Decimal Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.String Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.DateTime Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePutObject (System.Int32 FileNumber, System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
[System.ObsoleteAttribute("Use FilePutObject to write Object types, or coerce FileNumber and RecordNumber to Integer for writing non-Object types", false)]
|
||||
public static void FilePut (System.Object FileNumber, System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Object RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.ValueType Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Array Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean ArrayIsDynamic, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Boolean Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Byte Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Int16 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Int32 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Int64 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Char Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Single Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Double Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Decimal Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.String Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.DateTime Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Print (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void PrintLine (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Object Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Boolean Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Byte Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Int16 Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Int32 Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Int64 Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Char Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Single Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Double Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Decimal Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.String Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.DateTime Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Write (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void WriteLine (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String InputString (System.Int32 FileNumber, System.Int32 CharCount) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String LineInput (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Lock (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Lock (System.Int32 FileNumber, System.Int64 Record) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Lock (System.Int32 FileNumber, System.Int64 FromRecord, System.Int64 ToRecord) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Unlock (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Unlock (System.Int32 FileNumber, System.Int64 Record) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Unlock (System.Int32 FileNumber, System.Int64 FromRecord, System.Int64 ToRecord) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileWidth (System.Int32 FileNumber, System.Int32 RecordWidth) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.Int32 FreeFile () { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Seek (System.Int32 FileNumber, System.Int64 Position) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.Int64 Seek (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.Boolean EOF (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.Int64 Loc (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.Int64 LOF (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static Microsoft.VisualBasic.TabInfo TAB () { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static Microsoft.VisualBasic.TabInfo TAB (System.Int16 Column) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static Microsoft.VisualBasic.SpcInfo SPC (System.Int16 Count) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static Microsoft.VisualBasic.OpenMode FileAttr (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Reset () { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Rename (System.String OldPath, System.String NewPath) { throw new NotImplementedException (); }
|
||||
// Events
|
||||
};
|
||||
}
|
||||
{
|
||||
[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
|
||||
sealed public class FileSystem {
|
||||
private static System.IO.FileStream[] FHandle=new FileStream[255];
|
||||
// Declarations
|
||||
// Constructors
|
||||
// Properties
|
||||
// Methods
|
||||
[MonoTODO("Needs testing")]
|
||||
public static void ChDir (System.String Path)
|
||||
{
|
||||
if ( (Path=="") || (Path==null))
|
||||
throw new System.ArgumentException("Path is empty");
|
||||
try
|
||||
{
|
||||
Environment.CurrentDirectory=Path;
|
||||
}
|
||||
catch ( Exception e){ throw new System.IO.FileNotFoundException ("Invalid drive is specified, or drive is unavailable");}
|
||||
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static void ChDrive (System.Char Drive) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void ChDrive (System.String Drive) { throw new NotImplementedException (); }
|
||||
|
||||
[MonoTODO("Needs testing")]
|
||||
public static System.String CurDir ()
|
||||
{
|
||||
return Environment.CurrentDirectory;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static System.String CurDir (System.Char Drive) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String Dir () { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String Dir (System.String Pathname, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.FileAttribute Attributes) { throw new NotImplementedException (); }
|
||||
|
||||
[MonoTODO("Needs testing")]
|
||||
public static void MkDir (System.String Path)
|
||||
{
|
||||
// if a file called like 'path' does exist
|
||||
// no exception is generated using .net
|
||||
// A little extrange?
|
||||
if (Path==null || Path=="")
|
||||
{
|
||||
throw new System.ArgumentException();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (System.IO.Directory.Exists (Path))
|
||||
throw new System.IO.IOException("Directory already exists");
|
||||
else
|
||||
System.IO.Directory.CreateDirectory(Path);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO("Needs testing")]
|
||||
public static void RmDir (System.String Path)
|
||||
{
|
||||
System.IO.Directory.Delete(Path);
|
||||
}
|
||||
|
||||
[MonoTODO("Needs testing")]
|
||||
public static void FileCopy (System.String Source, System.String Destination)
|
||||
{
|
||||
// using VB, filecopy always overwrites Destination
|
||||
System.IO.File.Copy(Source,Destination,true);
|
||||
}
|
||||
|
||||
[MonoTODO("Needs testing")]
|
||||
public static System.DateTime FileDateTime (System.String PathName)
|
||||
{
|
||||
// A better exception handling is needed : exceptions
|
||||
// are not the same as 'GetLastWriteTime'
|
||||
return System.IO.File.GetLastWriteTime (PathName);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static System.Int64 FileLen (System.String PathName) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static Microsoft.VisualBasic.FileAttribute GetAttr (System.String PathName) { throw new NotImplementedException (); }
|
||||
|
||||
[MonoTODO("Needs testing")]
|
||||
public static void Kill (System.String PathName)
|
||||
{
|
||||
if (!System.IO.File.Exists(PathName))
|
||||
throw new System.IO.FileNotFoundException();
|
||||
else
|
||||
System.IO.File.Delete(PathName);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static void SetAttr (System.String PathName, Microsoft.VisualBasic.FileAttribute Attributes) { throw new NotImplementedException (); }
|
||||
|
||||
[MonoTODO("Needs testing")]
|
||||
public static void FileOpen (System.Int32 FileNumber, System.String FileName, Microsoft.VisualBasic.OpenMode Mode, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] Microsoft.VisualBasic.OpenAccess Access, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] Microsoft.VisualBasic.OpenShare Share, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int32 RecordLength)
|
||||
{
|
||||
// at this moment you can open a file
|
||||
// only for Append, Input or Output
|
||||
System.IO.FileMode MyMode;
|
||||
System.IO.FileAccess MyAccess;
|
||||
System.IO.FileShare MyShare;
|
||||
if ( RecordLength < -1 )
|
||||
throw new System.ArgumentException("Record Length is negative (nad not equal to -1)");
|
||||
if ( RecordLength > 32767)
|
||||
throw new System.ArgumentException ("Invalid Record Length");
|
||||
if (FileNumber <0 || FileNumber > 255)
|
||||
throw new System.IO.IOException(FileNumber.ToString() + " is invalid (<-1 or >255)",5);
|
||||
|
||||
FileNumber--;
|
||||
if (FHandle[FileNumber] != null)
|
||||
throw new System.IO.IOException (FileNumber.ToString() + " is in use",5);
|
||||
|
||||
switch (Mode)
|
||||
{
|
||||
case Microsoft.VisualBasic.OpenMode.Append :
|
||||
MyMode=System.IO.FileMode.Append ;
|
||||
break;
|
||||
case Microsoft.VisualBasic.OpenMode.Binary :
|
||||
throw new NotImplementedException ();
|
||||
|
||||
case Microsoft.VisualBasic.OpenMode.Input :
|
||||
MyMode=System.IO.FileMode.Open ;
|
||||
break;
|
||||
case Microsoft.VisualBasic.OpenMode.Output :
|
||||
MyMode=System.IO.FileMode.OpenOrCreate ;
|
||||
break;
|
||||
case Microsoft.VisualBasic.OpenMode.Random :
|
||||
throw new NotImplementedException ();
|
||||
default:
|
||||
throw new System.ArgumentException("Invalid Share");
|
||||
}
|
||||
switch (Access)
|
||||
{
|
||||
case Microsoft.VisualBasic.OpenAccess.ReadWrite :
|
||||
case Microsoft.VisualBasic.OpenAccess.Default :
|
||||
MyAccess=System.IO.FileAccess.ReadWrite;
|
||||
break;
|
||||
case Microsoft.VisualBasic.OpenAccess.Read :
|
||||
MyAccess=System.IO.FileAccess.Read;
|
||||
break;
|
||||
case Microsoft.VisualBasic.OpenAccess.Write :
|
||||
MyAccess=System.IO.FileAccess.Write;
|
||||
break;
|
||||
default:
|
||||
throw new System.ArgumentException("Invalid Access");
|
||||
|
||||
}
|
||||
switch(Share)
|
||||
{
|
||||
case Microsoft.VisualBasic.OpenShare.Default :
|
||||
case Microsoft.VisualBasic.OpenShare.Shared :
|
||||
MyShare=System.IO.FileShare.ReadWrite ;
|
||||
break;
|
||||
case Microsoft.VisualBasic.OpenShare.LockRead :
|
||||
MyShare=System.IO.FileShare.Write;
|
||||
break;
|
||||
case Microsoft.VisualBasic.OpenShare.LockReadWrite :
|
||||
MyShare=System.IO.FileShare.None ;
|
||||
break;
|
||||
case Microsoft.VisualBasic.OpenShare.LockWrite :
|
||||
MyShare=System.IO.FileShare.Read;
|
||||
break;
|
||||
default:
|
||||
throw new System.ArgumentException("Invalid Share");
|
||||
}
|
||||
FHandle[FileNumber]=new System.IO.FileStream (FileName,MyMode,MyAccess,MyShare);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
[MonoTODO("Needs testing")]
|
||||
public static void FileClose (params System.Int32[] FileNumbers)
|
||||
{
|
||||
int bucle=0;
|
||||
if (FileNumbers.Length == 0)
|
||||
{
|
||||
for(bucle=0;bucle<255;bucle++)
|
||||
{
|
||||
if (FHandle[bucle]!=null)
|
||||
try
|
||||
{
|
||||
FHandle[bucle].Close();
|
||||
}
|
||||
catch (Exception e) {e.GetType (); FHandle[bucle]=null ;}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(bucle=0;bucle<FileNumbers.Length;bucle++)
|
||||
{
|
||||
if ( FHandle [ FileNumbers[bucle] - 1 ] != null )
|
||||
{
|
||||
if (FileNumbers[bucle]>0 && FileNumbers[bucle]<256)
|
||||
{
|
||||
try
|
||||
{
|
||||
FHandle[ FileNumbers[bucle] - 1].Close();
|
||||
FHandle[ FileNumbers[bucle] - 1]=null;
|
||||
}
|
||||
catch (Exception e){e.GetType (); FHandle[ FileNumbers[bucle] - 1]= null ;}
|
||||
}
|
||||
else
|
||||
throw new System.IO.IOException (FileNumbers[bucle].ToString() + " Does not exist",52);
|
||||
}
|
||||
else
|
||||
throw new System.IO.IOException (FileNumbers[bucle].ToString() + " Does not exist",52);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static void FileGetObject (System.Int32 FileNumber, ref System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.ValueType Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Array Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean ArrayIsDynamic, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Boolean Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Byte Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Int16 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Int32 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Int64 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Char Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Single Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Double Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.Decimal Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.String Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileGet (System.Int32 FileNumber, ref System.DateTime Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePutObject (System.Int32 FileNumber, System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
[System.ObsoleteAttribute("Use FilePutObject to write Object types, or coerce FileNumber and RecordNumber to Integer for writing non-Object types", false)]
|
||||
public static void FilePut (System.Object FileNumber, System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Object RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.ValueType Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Array Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean ArrayIsDynamic, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Boolean Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Byte Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Int16 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Int32 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Int64 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Char Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Single Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Double Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.Decimal Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.String Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FilePut (System.Int32 FileNumber, System.DateTime Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Print (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void PrintLine (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Object Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Boolean Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Byte Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Int16 Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Int32 Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Int64 Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Char Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Single Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Double Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.Decimal Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.String Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Input (System.Int32 FileNumber, ref System.DateTime Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Write (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void WriteLine (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String InputString (System.Int32 FileNumber, System.Int32 CharCount) { throw new NotImplementedException (); }
|
||||
|
||||
[MonoTODO("Needs testing")]
|
||||
public static System.String LineInput (System.Int32 FileNumber)
|
||||
{
|
||||
string retval="";
|
||||
int buf='\x00';
|
||||
bool found=false;
|
||||
if ( FileNumber<1 || FileNumber>255)
|
||||
throw new System.IO.IOException (FileNumber.ToString() + " does not exists",52);
|
||||
if ( FHandle[FileNumber - 1] == null)
|
||||
throw new System.IO.IOException (FileNumber.ToString() + " does not exists",52);
|
||||
|
||||
if ( EOF(FileNumber) )
|
||||
throw new System.IO.EndOfStreamException();
|
||||
|
||||
while (!found)
|
||||
{
|
||||
|
||||
buf=FHandle[FileNumber - 1].ReadByte();
|
||||
if ( (buf == -1) || (buf == '\x0A' ) )
|
||||
found=true;
|
||||
else
|
||||
retval+= ((char)buf).ToString();
|
||||
}
|
||||
if ( retval.Length > 0 )
|
||||
if ( (buf == '\x0A') && (retval[retval.Length -1 ] == '\x0D') )
|
||||
retval=retval.Substring(0,retval.Length -1) ;
|
||||
Console.WriteLine (retval);
|
||||
return retval;
|
||||
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static void Lock (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Lock (System.Int32 FileNumber, System.Int64 Record) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Lock (System.Int32 FileNumber, System.Int64 FromRecord, System.Int64 ToRecord) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Unlock (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Unlock (System.Int32 FileNumber, System.Int64 Record) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Unlock (System.Int32 FileNumber, System.Int64 FromRecord, System.Int64 ToRecord) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void FileWidth (System.Int32 FileNumber, System.Int32 RecordWidth) { throw new NotImplementedException (); }
|
||||
|
||||
[MonoTODO("Needs testing")]
|
||||
public static System.Int32 FreeFile ()
|
||||
{
|
||||
int bucle=0;
|
||||
bool found=false;
|
||||
for (bucle=0;bucle<255;bucle++)
|
||||
if (FHandle[bucle]==null)
|
||||
{
|
||||
found=true;
|
||||
break;
|
||||
}
|
||||
if (!found)
|
||||
throw new System.IO.IOException ("More than 255 files are in use",67);
|
||||
else
|
||||
return bucle+1;
|
||||
}
|
||||
[MonoTODO]
|
||||
public static void Seek (System.Int32 FileNumber, System.Int64 Position) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.Int64 Seek (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
|
||||
[MonoTODO("Needs testing")]
|
||||
public static System.Boolean EOF ( System.Int32 FileNumber)
|
||||
{
|
||||
if (FileNumber<1 || FileNumber>255)
|
||||
throw new System.IO.IOException (FileNumber.ToString() + " does not exists",52);
|
||||
if ( FHandle[FileNumber - 1] == null)
|
||||
throw new System.IO.IOException (FileNumber.ToString() + " does not exists",52);
|
||||
if ( FHandle[FileNumber - 1].Length == FHandle[FileNumber - 1].Position)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static System.Int64 Loc (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.Int64 LOF (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static Microsoft.VisualBasic.TabInfo TAB () { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static Microsoft.VisualBasic.TabInfo TAB (System.Int16 Column) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static Microsoft.VisualBasic.SpcInfo SPC (System.Int16 Count) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static Microsoft.VisualBasic.OpenMode FileAttr (System.Int32 FileNumber) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Reset () { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Rename (System.String OldPath, System.String NewPath) { throw new NotImplementedException (); }
|
||||
// Events
|
||||
|
||||
};
|
||||
}
|
||||
@@ -3,8 +3,10 @@
|
||||
//
|
||||
// Author:
|
||||
// Chris J Breisch ([email protected])
|
||||
// Francesco Delfino ([email protected]
|
||||
//
|
||||
// (C) 2002 Chris J Breisch
|
||||
// 2003 Tipic, Inc. (http://www.tipic.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
@@ -18,7 +20,9 @@ namespace Microsoft.VisualBasic
|
||||
// Properties
|
||||
// Methods
|
||||
[MonoTODO]
|
||||
public static Microsoft.VisualBasic.ErrObject Err () { throw new NotImplementedException (); }
|
||||
public static Microsoft.VisualBasic.ErrObject Err () {
|
||||
return Microsoft.VisualBasic.CompilerServices.ProjectData.Err;
|
||||
}
|
||||
[MonoTODO]
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static System.Int32 Erl () { throw new NotImplementedException (); }
|
||||
|
||||
+9
-3
@@ -3,13 +3,15 @@
|
||||
//
|
||||
// Author:
|
||||
// Chris J Breisch ([email protected])
|
||||
// Francesco Delfino ([email protected])
|
||||
//
|
||||
// (C) 2002 Chris J Breisch
|
||||
// 2002 Tipic, Inc (http://www.tipic.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
{
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
|
||||
@@ -19,8 +21,12 @@ namespace Microsoft.VisualBasic.CompilerServices
|
||||
// Properties
|
||||
// Methods
|
||||
public static System.Boolean FromString (System.String Value) { return System.Boolean.Parse(Value); }
|
||||
[MonoTODO]
|
||||
public static System.Boolean FromObject (System.Object Value) { throw new NotImplementedException(); }
|
||||
public static System.Boolean FromObject (System.Object Value)
|
||||
{
|
||||
if ((object)Value == null) return false;
|
||||
//if (Value.GetType() == typeof(string)) return FromString((string)Value);
|
||||
else return System.Convert.ToBoolean(Value);
|
||||
}
|
||||
// Events
|
||||
};
|
||||
}
|
||||
+10
-3
@@ -3,13 +3,15 @@
|
||||
//
|
||||
// Author:
|
||||
// Chris J Breisch ([email protected])
|
||||
// Francesco Delfino ([email protected])
|
||||
//
|
||||
// (C) 2002 Chris J Breisch
|
||||
// 2002 Tipic, Inc (http://www.tipic.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
{
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
|
||||
@@ -19,8 +21,13 @@ namespace Microsoft.VisualBasic.CompilerServices
|
||||
// Properties
|
||||
// Methods
|
||||
public static System.Byte FromString (System.String Value) { return System.Byte.Parse(Value); }
|
||||
[MonoTODO]
|
||||
public static System.Byte FromObject (System.Object Value) { throw new NotImplementedException(); }
|
||||
|
||||
public static System.Byte FromObject (System.Object Value)
|
||||
{
|
||||
if ((object)Value == null) return 0;
|
||||
else return System.Convert.ToByte(Value);
|
||||
}
|
||||
|
||||
// Events
|
||||
};
|
||||
}
|
||||
+13
-5
@@ -3,13 +3,15 @@
|
||||
//
|
||||
// Author:
|
||||
// Chris J Breisch ([email protected])
|
||||
// Francesco Delfino ([email protected])
|
||||
//
|
||||
// (C) 2002 Chris J Breisch
|
||||
// 2002 Tipic, Inc (http://www.tipic.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
{
|
||||
[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
@@ -19,10 +21,16 @@ namespace Microsoft.VisualBasic.CompilerServices
|
||||
// Properties
|
||||
// Methods
|
||||
public static System.DateTime FromString (System.String Value) { return System.DateTime.Parse(Value); }
|
||||
[MonoTODO]
|
||||
public static System.DateTime FromString (System.String Value, System.Globalization.CultureInfo culture) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.DateTime FromObject (System.Object Value) { throw new NotImplementedException (); }
|
||||
public static System.DateTime FromString (System.String Value, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return System.DateTime.Parse (Value,culture);
|
||||
}
|
||||
public static System.DateTime FromObject (System.Object Value) {
|
||||
if ((object)Value ==null)
|
||||
return new DateTime(1,1,1);
|
||||
//if (Value.GetType() == typeof(string)) return FromString((string)Value);
|
||||
else return System.Convert.ToDateTime(Value);
|
||||
}
|
||||
// Events
|
||||
};
|
||||
}
|
||||
+10
-3
@@ -3,13 +3,15 @@
|
||||
//
|
||||
// Author:
|
||||
// Chris J Breisch ([email protected])
|
||||
// Francesco Delfino ([email protected])
|
||||
//
|
||||
// (C) 2002 Chris J Breisch
|
||||
// 2002 Tipic, Inc (http://www.tipic.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
{
|
||||
[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
@@ -19,8 +21,13 @@ namespace Microsoft.VisualBasic.CompilerServices
|
||||
// Properties
|
||||
// Methods
|
||||
public static System.Int32 FromString (System.String Value) { return System.Int32.Parse(Value); }
|
||||
[MonoTODO]
|
||||
public static System.Int32 FromObject (System.Object Value) { throw new NotImplementedException (); }
|
||||
|
||||
public static System.Int32 FromObject (System.Object Value)
|
||||
{
|
||||
if ((object)Value==null)
|
||||
return 0;
|
||||
else return System.Convert.ToInt32(Value);
|
||||
}
|
||||
// Events
|
||||
};
|
||||
}
|
||||
+3
-1
@@ -3,13 +3,15 @@
|
||||
//
|
||||
// Author:
|
||||
// Chris J Breisch ([email protected])
|
||||
// Francesco Delfino ([email protected])
|
||||
//
|
||||
// (C) 2002 Chris J Breisch
|
||||
// 2002 Tipic, Inc (http://www.tipic.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
{
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
sealed public class ObjectType {
|
||||
|
||||
+98
-80
@@ -1,80 +1,98 @@
|
||||
//
|
||||
// ProjectData.cs
|
||||
//
|
||||
// Authors:
|
||||
// Martin Adoue ([email protected])
|
||||
// Chris J Breisch ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian Inc.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// FIXME: Summary description for ProjectData.
|
||||
/// </summary>
|
||||
|
||||
[MonoTODO]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[StructLayout(LayoutKind.Auto)]
|
||||
public class ProjectData{
|
||||
|
||||
private static System.Exception projectError;
|
||||
private static int erl;
|
||||
|
||||
/// <summary>
|
||||
/// FIXME: Summary description for ClearProjectError
|
||||
/// </summary>
|
||||
public static void ClearProjectError()
|
||||
{
|
||||
projectError = null;
|
||||
erl = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FIXME: Summary description for SetProjectError
|
||||
/// </summary>
|
||||
/// <param name="ex">FIXME: Required. Summary description for ex</param>
|
||||
[MonoTODO]
|
||||
public static void SetProjectError(System.Exception ex)
|
||||
{
|
||||
SetProjectError(ex, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FIXME: Summary description for SetProjectError
|
||||
/// </summary>
|
||||
/// <param name="ex">FIXME: Required. Summary description for ex</param>
|
||||
/// <param name="lErl">FIXME: Required. Summary description for lErl</param>
|
||||
[MonoTODO]
|
||||
public static void SetProjectError(System.Exception ex, int lErl)
|
||||
{
|
||||
projectError = ex;
|
||||
erl = lErl;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
[MonoTODO]
|
||||
public static void EndApp()
|
||||
{
|
||||
//FIXME
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
[MonoTODO]
|
||||
protected static void Finalize()
|
||||
{
|
||||
//FIXME
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
// ProjectData.cs
|
||||
//
|
||||
// Authors:
|
||||
// Martin Adoue ([email protected])
|
||||
// Chris J Breisch ([email protected])
|
||||
// Francesco Delfino ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian Inc.
|
||||
// 2002 Tipic, Inc. (http://www.tipic.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// FIXME: Summary description for ProjectData.
|
||||
/// </summary>
|
||||
|
||||
[MonoTODO]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[StructLayout(LayoutKind.Auto)]
|
||||
public class ProjectData{
|
||||
|
||||
internal static System.Exception projectError;
|
||||
internal static int erl;
|
||||
internal static Microsoft.VisualBasic.ErrObject pErr;
|
||||
|
||||
internal static Microsoft.VisualBasic.ErrObject Err
|
||||
{
|
||||
get
|
||||
{
|
||||
if (pErr==null)
|
||||
pErr=new ErrObject();
|
||||
|
||||
return pErr;
|
||||
}
|
||||
set
|
||||
{
|
||||
pErr = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FIXME: Summary description for ClearProjectError
|
||||
/// </summary>
|
||||
public static void ClearProjectError()
|
||||
{
|
||||
projectError = null;
|
||||
erl = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FIXME: Summary description for SetProjectError
|
||||
/// </summary>
|
||||
/// <param name="ex">FIXME: Required. Summary description for ex</param>
|
||||
[MonoTODO]
|
||||
public static void SetProjectError(System.Exception ex)
|
||||
{
|
||||
SetProjectError(ex, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FIXME: Summary description for SetProjectError
|
||||
/// </summary>
|
||||
/// <param name="ex">FIXME: Required. Summary description for ex</param>
|
||||
/// <param name="lErl">FIXME: Required. Summary description for lErl</param>
|
||||
[MonoTODO]
|
||||
public static void SetProjectError(System.Exception ex, int lErl)
|
||||
{
|
||||
projectError = ex;
|
||||
erl = lErl;
|
||||
Err.SetException (ex);
|
||||
}
|
||||
|
||||
/*
|
||||
[MonoTODO]
|
||||
public static void EndApp()
|
||||
{
|
||||
//FIXME
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
[MonoTODO]
|
||||
protected static void Finalize()
|
||||
{
|
||||
//FIXME
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+64
-31
@@ -3,13 +3,15 @@
|
||||
//
|
||||
// Author:
|
||||
// Chris J Breisch ([email protected])
|
||||
// Francesco Delfino ([email protected])
|
||||
//
|
||||
// (C) 2002 Chris J Breisch
|
||||
// 2002 Tipic, Inc. (http://www.tipic.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
namespace Microsoft.VisualBasic.CompilerServices
|
||||
{
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
|
||||
@@ -18,36 +20,67 @@ namespace Microsoft.VisualBasic.CompilerServices
|
||||
// Constructors
|
||||
// Properties
|
||||
// Methods
|
||||
[MonoTODO]
|
||||
public static System.String FromBoolean (System.Boolean Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromByte (System.Byte Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromChar (System.Char Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromShort (System.Int16 Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromInteger (System.Int32 Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromLong (System.Int64 Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromSingle (System.Single Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromDouble (System.Double Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromSingle (System.Single Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromDouble (System.Double Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromDate (System.DateTime Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromDecimal (System.Decimal Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromDecimal (System.Decimal Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.String FromObject (System.Object Value) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.Int32 StrCmp (System.String sLeft, System.String sRight, System.Boolean TextCompare) { throw new NotImplementedException (); }
|
||||
public static System.String FromBoolean (System.Boolean Value) {
|
||||
return Convert.ToString(Value);
|
||||
}
|
||||
public static System.String FromByte (System.Byte Value)
|
||||
{
|
||||
return Convert.ToString(Value);
|
||||
}
|
||||
public static System.String FromChar (System.Char Value)
|
||||
{
|
||||
return Convert.ToString(Value);
|
||||
}
|
||||
public static System.String FromShort (System.Int16 Value)
|
||||
{
|
||||
return Convert.ToString(Value);
|
||||
}
|
||||
public static System.String FromInteger (System.Int32 Value)
|
||||
{
|
||||
return Convert.ToString(Value);
|
||||
}
|
||||
public static System.String FromLong (System.Int64 Value)
|
||||
{
|
||||
return Convert.ToString(Value);
|
||||
}
|
||||
public static System.String FromSingle (System.Single Value)
|
||||
{
|
||||
return Convert.ToString(Value);
|
||||
}
|
||||
public static System.String FromDouble (System.Double Value)
|
||||
{
|
||||
return Convert.ToString(Value);
|
||||
}
|
||||
public static System.String FromSingle (System.Single Value, System.Globalization.NumberFormatInfo NumberFormat)
|
||||
{
|
||||
return Convert.ToString(Value,NumberFormat);
|
||||
}
|
||||
public static System.String FromDouble (System.Double Value, System.Globalization.NumberFormatInfo NumberFormat)
|
||||
{
|
||||
return Convert.ToString(Value,NumberFormat);
|
||||
}
|
||||
public static System.String FromDate (System.DateTime Value)
|
||||
{
|
||||
return Convert.ToString(Value);
|
||||
}
|
||||
public static System.String FromDecimal (System.Decimal Value)
|
||||
{
|
||||
return Convert.ToString(Value);
|
||||
}
|
||||
public static System.String FromDecimal (System.Decimal Value, System.Globalization.NumberFormatInfo NumberFormat)
|
||||
{
|
||||
return Convert.ToString(Value,NumberFormat);
|
||||
}
|
||||
public static System.String FromObject (System.Object Value)
|
||||
{
|
||||
if ((object)Value==null) return "";
|
||||
else return Convert.ToString(Value);
|
||||
}
|
||||
[MonoTODO("Last boolean parameter ignored")]
|
||||
public static System.Int32 StrCmp (System.String sLeft, System.String sRight, System.Boolean TextCompare)
|
||||
{
|
||||
return sLeft.CompareTo(sRight);
|
||||
}
|
||||
[MonoTODO]
|
||||
public static System.Boolean StrLike (System.String Source, System.String Pattern, Microsoft.VisualBasic.CompareMethod CompareOption) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
|
||||
@@ -4,8 +4,12 @@
|
||||
// Authors:
|
||||
// Martin Adoue ([email protected])
|
||||
// Chris J Breisch ([email protected])
|
||||
// Francesco Delfino ([email protected])
|
||||
// Daniel Campos ([email protected])
|
||||
// Rafael Teixeira ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian Inc.
|
||||
// 2002 Tipic, Inc. (http://www.tipic.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
@@ -36,12 +40,11 @@ namespace Microsoft.VisualBasic
|
||||
/// </summary>
|
||||
/// <param name="String">Required. Any valid Char or String expression. If String is a String expression, only the first character of the string is used for input. If String is Nothing or contains no characters, an ArgumentException error occurs.</param>
|
||||
[MonoTODO]
|
||||
public static int Asc(char String)
|
||||
public static int Asc(char Char)
|
||||
{
|
||||
//FIXME: Check the docs, it says something about Locales, DBCS, etc.
|
||||
throw new NotImplementedException();
|
||||
return (int)Char;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -51,8 +54,8 @@ namespace Microsoft.VisualBasic
|
||||
[MonoTODO]
|
||||
public static int Asc(string String)
|
||||
{
|
||||
if ((String == null) || (String.Length != 1))
|
||||
throw new ArgumentException("Length of argument 'String' must be one.", "String");
|
||||
if ((String == null) || (String.Length < 1))
|
||||
throw new ArgumentException("Length of argument 'String' must be at least one.", "String");
|
||||
|
||||
//FIXME: Check the docs, it says something about Locales, DBCS, etc.
|
||||
return (int) String.ToCharArray(0, 1)[0];
|
||||
@@ -277,7 +280,7 @@ namespace Microsoft.VisualBasic
|
||||
/// Returns an expression formatted as a currency value using the currency symbol defined in the system control panel.
|
||||
/// </summary>
|
||||
/// <param name="Expression">Required. Expression to be formatted.</param>
|
||||
/// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is –1, which indicates that the computer's regional settings are used.</param>
|
||||
/// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is 1, which indicates that the computer's regional settings are used.</param>
|
||||
/// <param name="IncludeLeadingDigit">Optional. Tristate enumeration that indicates whether or not a leading zero is displayed for fractional values. See Settings for values.</param>
|
||||
/// <param name="UseParensForNegativeNumbers">Optional. Tristate enumeration that indicates whether or not to place negative values within parentheses. See Settings for values.</param>
|
||||
/// <param name="GroupDigits">Optional. Tristate enumeration that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. See Settings for values.</param>
|
||||
@@ -335,7 +338,7 @@ namespace Microsoft.VisualBasic
|
||||
/// Returns an expression formatted as a number.
|
||||
/// </summary>
|
||||
/// <param name="Expression">Required. Expression to be formatted.</param>
|
||||
/// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is –1, which indicates that the computer's regional settings are used.</param>
|
||||
/// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is 1, which indicates that the computer's regional settings are used.</param>
|
||||
/// <param name="IncludeLeadingDigit">Optional. Tristate enumeration that indicates whether or not a leading zero is displayed for fractional values. See Settings for values.</param>
|
||||
/// <param name="UseParensForNegativeNumbers">Optional. Tristate enumeration that indicates whether or not to place negative values within parentheses. See Settings for values.</param>
|
||||
/// <param name="GroupDigits">Optional. Tristate enumeration that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. See Settings for values.</param>
|
||||
@@ -363,7 +366,7 @@ namespace Microsoft.VisualBasic
|
||||
/// Returns an expression formatted as a percentage (that is, multiplied by 100) with a trailing % character.
|
||||
/// </summary>
|
||||
/// <param name="Expression">Required. Expression to be formatted.</param>
|
||||
/// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is –1, which indicates that the computer's regional settings are used.</param>
|
||||
/// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is 1, which indicates that the computer's regional settings are used.</param>
|
||||
/// <param name="IncludeLeadingDigit">Optional. Tristate enumeration that indicates whether or not a leading zero is displayed for fractional values. See Settings for values.</param>
|
||||
/// <param name="UseParensForNegativeNumbers">Optional. Tristate enumeration that indicates whether or not to place negative values within parentheses. See Settings for values.</param>
|
||||
/// <param name="GroupDigits">Optional. Tristate enumeration that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. See Settings for values.</param>
|
||||
@@ -407,6 +410,23 @@ namespace Microsoft.VisualBasic
|
||||
return Str.ToCharArray(Index -1, 1)[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an integer specifying the start position of the first occurrence of one string within another.
|
||||
/// </summary>
|
||||
/// <param name="Start">Required. Numeric expression that sets the starting position for each search. If omitted, search begins at the first character position. The start index is 1 based.</param>
|
||||
/// <param name="String1">Required. String expression being searched.</param>
|
||||
/// <param name="String2">Required. String expression sought.</param>
|
||||
/// <param name="Compare">Optional. Specifies the type of string comparison. If Compare is omitted, the Option Compare setting determines the type of comparison. Specify a valid LCID (LocaleID) to use locale-specific rules in the comparison. </param>
|
||||
[MonoTODO("Needs testing")]
|
||||
public static int InStr(string String1,
|
||||
string String2,
|
||||
[OptionCompare]
|
||||
[Optional]
|
||||
[DefaultValue(CompareMethod.Binary)]
|
||||
CompareMethod Compare)
|
||||
{
|
||||
return InStr(1, String1, String2, Compare);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an integer specifying the start position of the first occurrence of one string within another.
|
||||
@@ -445,14 +465,13 @@ namespace Microsoft.VisualBasic
|
||||
*/
|
||||
|
||||
//FIXME: someone with a non US setup should test this.
|
||||
|
||||
switch (Compare)
|
||||
{
|
||||
case CompareMethod.Text:
|
||||
return System.Globalization.CultureInfo.CurrentCulture.CompareInfo.IndexOf(String2, String1, Start - 1) + 1;
|
||||
|
||||
case CompareMethod.Binary:
|
||||
return String2.IndexOf(String1, Start - 1) + 1;
|
||||
return String1.IndexOf(String2, Start - 1) + 1;
|
||||
default:
|
||||
throw new System.ArgumentException("Argument 'Compare' must be CompareMethod.Binary or CompareMethod.Text.", "Compare");
|
||||
}
|
||||
@@ -465,7 +484,7 @@ namespace Microsoft.VisualBasic
|
||||
/// </summary>
|
||||
/// <param name="StringCheck">Required. String expression being searched.</param>
|
||||
/// <param name="StringMatch">Required. String expression being searched for.</param>
|
||||
/// <param name="Start">Optional. Numeric expression that sets the one-based starting position for each search, starting from the left side of the string. If Start is omitted, –1 is used, which means that the search begins at the last character position. Search then proceeds from right to left.</param>
|
||||
/// <param name="Start">Optional. Numeric expression that sets the one-based starting position for each search, starting from the left side of the string. If Start is omitted, 1 is used, which means that the search begins at the last character position. Search then proceeds from right to left.</param>
|
||||
/// <param name="Compare">Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. If omitted, a binary comparison is performed. See Settings for values.</param>
|
||||
[MonoTODO]
|
||||
public static int InStrRev(string StringCheck,
|
||||
@@ -721,8 +740,7 @@ namespace Microsoft.VisualBasic
|
||||
if ((Str == null) || (Str.Length == 0))
|
||||
return String.Empty; // VB.net does this.
|
||||
|
||||
Str.TrimStart(null);
|
||||
return Str;
|
||||
return Str.TrimStart(null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -735,8 +753,7 @@ namespace Microsoft.VisualBasic
|
||||
if ((Str == null) || (Str.Length == 0))
|
||||
return String.Empty; // VB.net does this.
|
||||
|
||||
Str.TrimEnd(null);
|
||||
return Str;
|
||||
return Str.TrimEnd(null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -749,8 +766,7 @@ namespace Microsoft.VisualBasic
|
||||
if ((Str == null) || (Str.Length == 0))
|
||||
return String.Empty; // VB.net does this.
|
||||
|
||||
Str.Trim();
|
||||
return Str;
|
||||
return Str.Trim();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -808,7 +824,7 @@ namespace Microsoft.VisualBasic
|
||||
/// <param name="Find">Required. Substring being searched for.</param>
|
||||
/// <param name="Replacement">Required. Replacement substring.</param>
|
||||
/// <param name="Start">Optional. Position within Expression where substring search is to begin. If omitted, 1 is assumed.</param>
|
||||
/// <param name="Count">Optional. Number of substring substitutions to perform. If omitted, the default value is –1, which means make all possible substitutions.</param>
|
||||
/// <param name="Count">Optional. Number of substring substitutions to perform. If omitted, the default value is 1, which means make all possible substitutions.</param>
|
||||
/// <param name="Compare">Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings for values.</param>
|
||||
[MonoTODO("Needs testing")]
|
||||
public static string Replace(string Expression,
|
||||
@@ -853,8 +869,7 @@ namespace Microsoft.VisualBasic
|
||||
if (Length < 0)
|
||||
throw new ArgumentException("Argument 'Length' must be greater or equal to zero.", "Length");
|
||||
|
||||
//FIXME
|
||||
throw new NotImplementedException();
|
||||
return Str.Substring (Str.Length - Length);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -893,7 +908,7 @@ namespace Microsoft.VisualBasic
|
||||
/// </summary>
|
||||
/// <param name="Expression">Required. String expression containing substrings and delimiters. If Expression is a zero-length string (""), the Split function returns an array with no elements and no data.</param>
|
||||
/// <param name="Delimiter">Optional. Single character used to identify substring limits. If Delimiter is omitted, the space character (" ") is assumed to be the delimiter. If Delimiter is a zero-length string, a single-element array containing the entire Expression string is returned.</param>
|
||||
/// <param name="Limit">Optional. Number of substrings to be returned; the default, –1, indicates that all substrings are returned.</param>
|
||||
/// <param name="Limit">Optional. Number of substrings to be returned; the default, 1, indicates that all substrings are returned.</param>
|
||||
/// <param name="Compare">Optional. Numeric value indicating the comparison to use when evaluating substrings. See Settings for values.</param>
|
||||
[MonoTODO]
|
||||
public static string[] Split(string Expression,
|
||||
@@ -1059,27 +1074,26 @@ namespace Microsoft.VisualBasic
|
||||
/// <param name="Expression">Required. String expression whose characters are to be reversed. If Expression is a zero-length string (""), a zero-length string is returned.</param>
|
||||
public static string StrReverse(string Expression)
|
||||
{
|
||||
|
||||
if (Expression == null)
|
||||
return String.Empty; // "If Expression is a zero-length string (""), a zero-length string is returned."
|
||||
|
||||
int count = Expression.Length;
|
||||
|
||||
if (count == 0)
|
||||
return String.Empty; // "If Expression is a zero-length string (""), a zero-length string is returned."
|
||||
|
||||
/*
|
||||
* This would be much faster if I had access to the internal array.
|
||||
* I'd just reverse the array. Maybe as strings are inmutable in .net (is this true in Mono?)
|
||||
* it'll be the same. Comments?
|
||||
*/
|
||||
char[] chars = new char[count - 1];
|
||||
chars = Expression.ToCharArray();
|
||||
|
||||
System.Array.Reverse (chars);
|
||||
|
||||
return new string(chars);
|
||||
|
||||
// patched by Daniel Campos
|
||||
// [email protected]
|
||||
if (Expression != null)
|
||||
{
|
||||
if ( Expression.Length>0)
|
||||
{
|
||||
int counter=0;
|
||||
char[] buf=new char[Expression.Length];
|
||||
|
||||
for (int backwardsCounter=Expression.Length - 1;
|
||||
backwardsCounter>=0;
|
||||
backwardsCounter--)
|
||||
buf[counter++]=Expression[backwardsCounter];
|
||||
return new string(buf);
|
||||
}
|
||||
else
|
||||
return String.Empty;
|
||||
}
|
||||
else
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
//
|
||||
// Author:
|
||||
// Chris J Breisch ([email protected])
|
||||
// Francesco Delfino ([email protected])
|
||||
//
|
||||
// (C) 2002 Chris J Breisch
|
||||
// (C) 2002 Tipic Inc
|
||||
//
|
||||
|
||||
using System;
|
||||
@@ -15,15 +17,37 @@ namespace Microsoft.VisualBasic {
|
||||
// Declarations
|
||||
// Constructors
|
||||
// Properties
|
||||
static Random rnd = new Random();
|
||||
static float last = (float)rnd.NextDouble();
|
||||
// Methods
|
||||
[MonoTODO]
|
||||
public static System.Single Rnd () { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static System.Single Rnd (System.Single Number) { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Randomize () { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
public static void Randomize (System.Double Number) { throw new NotImplementedException (); }
|
||||
public static float Rnd () {
|
||||
last = (float)rnd.NextDouble();
|
||||
return last;
|
||||
}
|
||||
public static float Rnd (float Number)
|
||||
{
|
||||
if (Number == 0.0)
|
||||
{
|
||||
return last;
|
||||
}
|
||||
else if (Number < 0.0 )
|
||||
{
|
||||
//fd: What does this mean?
|
||||
//fd: ms-help://MS.VSCC/MS.MSDNVS/script56/html/vsstmRandomize
|
||||
//fd: ms-help://MS.VSCC/MS.MSDNVS/script56/html/vsfctrnd.htm
|
||||
Randomize(Number);
|
||||
return Rnd();
|
||||
}
|
||||
return Rnd();
|
||||
}
|
||||
public static void Randomize () {
|
||||
rnd = new Random();
|
||||
}
|
||||
[MonoTODO("Rethink the double => int conversion")]
|
||||
public static void Randomize (double Number)
|
||||
{
|
||||
rnd = new Random((int)Number);
|
||||
}
|
||||
// Events
|
||||
};
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
2003-01-17 Zoltan Varga <[email protected]>
|
||||
|
||||
* MonoSymbolWriter.cs (OpenMethod): Make it work on constructors.
|
||||
|
||||
2002-10-13 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Set version number to 28.
|
||||
|
||||
@@ -517,7 +517,7 @@ namespace Mono.CSharp.Debugger
|
||||
|
||||
int index = (token & 0xffffff) - 1;
|
||||
|
||||
MethodBuilder mb = (MethodBuilder) mbuilder_array [index];
|
||||
MethodBase mb = (MethodBase) mbuilder_array [index];
|
||||
|
||||
current_method = new SourceMethod (mb);
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
2003-01-16 Daniel Morgan <[email protected]>
|
||||
|
||||
* Mono.Data.Db2Client/DB2ClientConnection.cs: added parsing and setting
|
||||
of connection string values. Prior to this change, the server, username, and
|
||||
authentication were hard-coded.
|
||||
|
||||
* Mono.Data.Db2Client/DB2ClientUtils.cs: prevent warning about
|
||||
unreachable code
|
||||
|
||||
* Test/TestDB2Conn/TestDB2Conn.cs: modify test to accept
|
||||
database, username, and password from command line. Also, test
|
||||
a CREATE TABLE statement with ExecuteNonQuery()
|
||||
|
||||
2003-01-16 Daniel Morgan <[email protected]>
|
||||
|
||||
* Mono.Data.Db2Client.build: added file for Windows build
|
||||
|
||||
2003-01-16 Rodrigo Moya <[email protected]>
|
||||
|
||||
* makefile.gnu: added --unsafe command line option, needed for unsafe
|
||||
code. The IBM DB2 provider now compiles on Mono.
|
||||
|
||||
* list: added missing file.
|
||||
|
||||
2003-01-15 Rodrigo Moya <[email protected]>
|
||||
|
||||
Added IBM DB2 provider from cleared <[email protected]>.
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- NAnt build file for Mono.Data.DB2Client.dll -->
|
||||
|
||||
<project name="Mono.Data.DB2Client" default="build">
|
||||
<property name="debug" value="false"/>
|
||||
|
||||
<target name="build">
|
||||
<csc target="library" output="../lib/Mono.Data.DB2Client.dll" debug="${debug}">
|
||||
<arg value="/nowarn:1595"/>
|
||||
<arg value="/nowarn:0067"/>
|
||||
<arg value="/nowarn:0109"/>
|
||||
<arg value="/nowarn:0169"/>
|
||||
<arg value="/nowarn:0649"/>
|
||||
<arg value="/unsafe"/>
|
||||
<arg value="/noconfig"/>
|
||||
<arg value="/r:System.dll"/>
|
||||
<arg value="/r:System.Xml.dll"/>
|
||||
<arg value="/r:System.Data.dll"/>
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
<excludes name="Test/**"/>
|
||||
</sources>
|
||||
<references>
|
||||
<includes name="../lib/corlib.dll"/>
|
||||
<includes name="../lib/System.dll"/>
|
||||
<includes name="../lib/System.Xml.dll"/>
|
||||
<includes name="../lib/System.Data.dll"/>
|
||||
</references>
|
||||
</csc>
|
||||
<copy file="../lib/System.Data.dll" tofile="Test/System.Data.dll"/>
|
||||
<copy file="../lib/Mono.Data.DB2Client.dll" tofile="Test/Mono.Data.DB2Client.dll"/>
|
||||
<copy file="../lib/Mono.Data.DB2Client.dll" tofile="Mono.Data.DB2Client/Mono.Data.DB2Client.dll"/>
|
||||
<copy file="../lib/Mono.Data.DB2Client.dll" tofile="../System.Data/Test/Mono.Data.DB2Client.dll"/>
|
||||
</target>
|
||||
<target name="test" depends="build">
|
||||
<nant basedir="Test" target="test"/>
|
||||
</target>
|
||||
<target name="clean">
|
||||
<delete file="Test/System.Data.dll" failonerror="false"/>
|
||||
<delete file="../lib/Mono.Data.DB2Client.dll" failonerror="false"/>
|
||||
<delete file="Test/Mono.Data.DB2Client.dll" failonerror="false"/>
|
||||
</target>
|
||||
</project>
|
||||
+6
-14
@@ -1,11 +1,3 @@
|
||||
//
|
||||
// AssemblyInfo.cs: Assembly information
|
||||
//
|
||||
// Author: Jonathan Pryor ([email protected])
|
||||
//
|
||||
// (C) 2003 Jonathan Pryor
|
||||
//
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
@@ -14,12 +6,12 @@ using System.Runtime.CompilerServices;
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("Type Reflector")]
|
||||
[assembly: AssemblyDescription("Displays System.Reflection Information for .NET Types")]
|
||||
[assembly: AssemblyTitle("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Jon Pryor Research Labs")]
|
||||
[assembly: AssemblyProduct("Type Reflector")]
|
||||
[assembly: AssemblyCopyright("Copyright (C) 2002-2003")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -34,7 +26,7 @@ using System.Runtime.CompilerServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("0.6.*")]
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
@@ -0,0 +1,279 @@
|
||||
#region Licence
|
||||
/// DB2DriverCS - A DB2 driver for .Net
|
||||
/// Copyright 2003 By Christopher Bockner
|
||||
/// Released under the terms of the MIT/X11 Licence
|
||||
/// Please refer to the Licence.txt file that should be distributed with this package
|
||||
/// This software requires that DB2 client software be installed correctly on the machine
|
||||
/// (or instance) on which the driver is running.
|
||||
#endregion
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for DB2ClientCommand.
|
||||
/// </summary>
|
||||
public class DB2ClientCommand : IDbCommand
|
||||
{
|
||||
#region Private data members
|
||||
private string commandText;
|
||||
private DB2ClientConnection db2Conn;
|
||||
private DB2ClientTransaction db2Trans;
|
||||
private int commandTimeout;
|
||||
private bool prepared = false;
|
||||
private IntPtr hwndStmt; //Our statement handle
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Default constructor. Since I'm using CLI functions to do this stuff, we're stuck
|
||||
/// until we get the database environment handle.
|
||||
/// </summary>
|
||||
public DB2ClientCommand()
|
||||
{
|
||||
hwndStmt = IntPtr.Zero;
|
||||
}
|
||||
public DB2ClientCommand(string commandStr)
|
||||
{
|
||||
commandText = commandStr;
|
||||
hwndStmt = IntPtr.Zero;
|
||||
}
|
||||
public DB2ClientCommand(string commandStr, DB2ClientConnection con)
|
||||
{
|
||||
commandText = commandStr;
|
||||
db2Conn = con;
|
||||
AllocateStatement("Constructor 3");
|
||||
}
|
||||
public DB2ClientCommand (string commandStr, DB2ClientConnection con, DB2ClientTransaction trans)
|
||||
{
|
||||
commandText = commandStr;
|
||||
db2Conn = con;
|
||||
db2Trans = trans;
|
||||
AllocateStatement("Constructor 4");
|
||||
}
|
||||
///DB2 Specific constructors
|
||||
///
|
||||
public DB2ClientCommand (IntPtr hwndSt)
|
||||
{
|
||||
hwndStmt = hwndSt;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
#region CommandText property
|
||||
///
|
||||
///The query
|
||||
///
|
||||
public string CommandText
|
||||
{
|
||||
get
|
||||
{
|
||||
return commandText;
|
||||
}
|
||||
set
|
||||
{
|
||||
commandText = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region CommandTimeout property
|
||||
///
|
||||
/// The Timeout property states how long we wait for results to return
|
||||
///
|
||||
public int CommandTimeout
|
||||
{
|
||||
get
|
||||
{
|
||||
return commandTimeout;
|
||||
}
|
||||
set
|
||||
{
|
||||
commandTimeout = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region CommandType property
|
||||
///
|
||||
/// I believe this one is left as text all of the time for DB2, but I have to check that...
|
||||
///
|
||||
public CommandType CommandType
|
||||
{
|
||||
get
|
||||
{
|
||||
return CommandType.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
///Do nothing
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Connection property
|
||||
///
|
||||
/// The connection we'll be executing on.
|
||||
///
|
||||
public IDbConnection Connection
|
||||
{
|
||||
get
|
||||
{
|
||||
return db2Conn;
|
||||
}
|
||||
set
|
||||
{
|
||||
db2Conn = (DB2ClientConnection)value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Parameters property
|
||||
///
|
||||
/// Parameter list, Not yet implemented
|
||||
///
|
||||
public IDataParameterCollection Parameters
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new DB2ClientException("TBD");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Transaction property
|
||||
///
|
||||
/// The transaction this command is associated with
|
||||
///
|
||||
public IDbTransaction Transaction
|
||||
{
|
||||
get
|
||||
{
|
||||
return db2Trans;
|
||||
}
|
||||
set
|
||||
{
|
||||
db2Trans = (DB2ClientTransaction)value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region UpdatedRowSource property
|
||||
///
|
||||
/// Need to see how this works with DB2...
|
||||
///
|
||||
public UpdateRowSource UpdatedRowSource
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new DB2ClientException ("TBD");
|
||||
}
|
||||
set
|
||||
{
|
||||
throw new DB2ClientException ("TBD");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Statement Handle
|
||||
///
|
||||
/// returns the DB2Client statement handle
|
||||
///
|
||||
public IntPtr statementHandle
|
||||
{
|
||||
get
|
||||
{
|
||||
return hwndStmt;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region AllocateStatement function
|
||||
///
|
||||
/// Allocate a statement handle, internal. Pass in the name of the caller for exception info.
|
||||
/// I think I'll make the handle a property and add a constructor with the handle argument so that
|
||||
/// statements can be executed on the same handle if need be, though you could accomplish the same by
|
||||
/// just keeping the command object open.
|
||||
///
|
||||
internal void AllocateStatement(string location)
|
||||
{
|
||||
short sqlRet;
|
||||
sqlRet = DB2ClientPrototypes.SQLAllocHandle(DB2ClientConstants.SQL_HANDLE_STMT, db2Conn.DBHandle, ref hwndStmt);
|
||||
if (sqlRet == DB2ClientConstants.SQL_ERROR)
|
||||
throw new DB2ClientException(DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, location +": Unable to allocate statement handle.");
|
||||
}
|
||||
#endregion
|
||||
#region Cancel
|
||||
/// <summary>
|
||||
/// Attempt to cancel an executing command
|
||||
/// </summary>
|
||||
public void Cancel()
|
||||
{
|
||||
DB2ClientPrototypes.SQLCancel(hwndStmt);
|
||||
}
|
||||
#endregion
|
||||
#region CreateParameter
|
||||
///
|
||||
///Returns a parameter
|
||||
///
|
||||
public IDbDataParameter CreateParameter()
|
||||
{
|
||||
//Will wait until I get deeper into the DB2/.Net interface. I'm not sure how
|
||||
//.Net and DB2 parameters talk to each other
|
||||
throw new DB2ClientException("Parameters not yet supported in this driver.");
|
||||
}
|
||||
#endregion
|
||||
#region ExecuteNonQuery
|
||||
///
|
||||
/// ExecuteNonQuery Executes an SQL statement without returning a DataSet
|
||||
///
|
||||
public int ExecuteNonQuery()
|
||||
{
|
||||
short sqlRet;
|
||||
if (prepared)
|
||||
sqlRet = DB2ClientPrototypes.SQLExecute(hwndStmt);
|
||||
else
|
||||
sqlRet = DB2ClientPrototypes.SQLExecDirect(hwndStmt, commandText, commandText.Length);
|
||||
|
||||
int numRows = 0;
|
||||
sqlRet = DB2ClientPrototypes.SQLRowCount(hwndStmt, ref numRows); //How many rows affected. numRows will be -1 if we aren't dealing with an Insert, Delete or Update, or if the statement did not execute successfully
|
||||
///At this point, I think we need to save any results, but not return them
|
||||
///For now, we will go execute and return the number of rows affected
|
||||
return numRows;
|
||||
}
|
||||
#endregion
|
||||
#region ExecuteReader calls
|
||||
///
|
||||
///ExecuteReader
|
||||
///
|
||||
public IDataReader ExecuteReader()
|
||||
{
|
||||
|
||||
ExecuteNonQuery();
|
||||
DB2ClientDataReader reader = new DB2ClientDataReader(db2Conn, this);
|
||||
return reader;
|
||||
|
||||
}
|
||||
public IDataReader ExecuteReader(CommandBehavior behavior)
|
||||
{
|
||||
throw new DB2ClientException("TBD");
|
||||
}
|
||||
#endregion
|
||||
#region ExecuteScalar
|
||||
///
|
||||
/// ExecuteScalar
|
||||
///
|
||||
public object ExecuteScalar()
|
||||
{
|
||||
throw new DB2ClientException("TBD");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Prepare
|
||||
///
|
||||
/// Prepare
|
||||
///
|
||||
public void Prepare()
|
||||
{
|
||||
throw new DB2ClientException("TBD");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
#region Licence
|
||||
/// DB2DriverCS - A DB2 driver for .Net
|
||||
///
|
||||
/// Authors:
|
||||
/// Christopher Bockner
|
||||
///
|
||||
/// Copyright 2003 By Christopher Bockner
|
||||
///
|
||||
/// Released under the terms of the MIT/X11 Licence
|
||||
/// Please refer to the Licence.txt file that should be distributed with this package
|
||||
/// This software requires that DB2 client software be installed correctly on the machine
|
||||
/// (or instance) on which the driver is running.
|
||||
#endregion
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using System.Data;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
/// <summary> /// This class is IDbConnection compliant. Refer to MSDN documentation for reference.
|
||||
/// </summary>
|
||||
///
|
||||
|
||||
public class DB2ClientConnection : IDbConnection
|
||||
{
|
||||
private string connectionString = null;
|
||||
private StringBuilder outConnectStr;
|
||||
private string dbName = null;
|
||||
private int connectionTimeout;
|
||||
|
||||
private IntPtr dbHandle = IntPtr.Zero;
|
||||
private bool disposed = false;
|
||||
public DB2ClientConnection()
|
||||
{
|
||||
//
|
||||
// TODO: Add constructor logic here
|
||||
//
|
||||
}
|
||||
public DB2ClientConnection(string conString)
|
||||
{
|
||||
SetConnectionString(conString);
|
||||
}
|
||||
#region ConnectionString property
|
||||
///
|
||||
///Accessor for the connectionString property
|
||||
public string ConnectionString
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectionString;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetConnectionString(value);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region ConnectionTimeout property
|
||||
public int ConnectionTimeout
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectionTimeout;
|
||||
}
|
||||
set
|
||||
{
|
||||
connectionTimeout = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Database property
|
||||
public string Database
|
||||
{
|
||||
get
|
||||
{
|
||||
return dbName;
|
||||
}
|
||||
set
|
||||
{
|
||||
dbName = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region State property
|
||||
/// <summary>
|
||||
/// The Connection State property, open or closed.
|
||||
/// NOTE: IBM's docs on SqlFreeHandle do not state what is done when a handle is freed
|
||||
/// i.e. if the handle is set to SQL_NULL_HANDLE.
|
||||
/// </summary>
|
||||
|
||||
unsafe public ConnectionState State
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((long)dbHandle.ToPointer() == DB2ClientConstants.SQL_NULL_HANDLE)
|
||||
return ConnectionState.Closed;
|
||||
else
|
||||
return ConnectionState.Open;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region DBHandle
|
||||
///
|
||||
/// Handle Returns an IntPtr of the dbm handle
|
||||
///
|
||||
public IntPtr DBHandle
|
||||
{
|
||||
get
|
||||
{
|
||||
return dbHandle;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region BeginTransaction Method
|
||||
/// <summary>
|
||||
/// Opens a transaction against the database at the default isolation level, which will be
|
||||
/// that which the packages were bound at, unless overriden in the connection string, and if nothing was specified at that point
|
||||
/// then I believe the default level is Cursor Stability (don't quote me on that, I haven't
|
||||
/// found the appropriate reference yet), ODBC equivalent is SQL_TXN_READ_COMMITTED
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IDbTransaction BeginTransaction()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
#region BeginTransaction (IsolationLevel) Method
|
||||
/// <summary>
|
||||
/// BeginTransaction again overloadded to let us set the transaction level for the statement
|
||||
/// </summary>
|
||||
/// <param name="isolationL"></param>
|
||||
/// <returns></returns>
|
||||
public IDbTransaction BeginTransaction(IsolationLevel isolationL)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
#region ChangeDatabase
|
||||
unsafe public void ChangeDatabase(string newDBName)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
#region Close
|
||||
///Close, per MSDN documentation
|
||||
///
|
||||
unsafe public void Close()
|
||||
{
|
||||
DB2ClientPrototypes.SQLDisconnect(dbHandle);
|
||||
dbHandle = new IntPtr(DB2ClientConstants.SQL_NULL_HANDLE);
|
||||
}
|
||||
#endregion
|
||||
#region CreateCommand
|
||||
/// <summary>
|
||||
/// CreateCommand per MSDN
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IDbCommand CreateCommand()
|
||||
{
|
||||
CheckState();
|
||||
return new DB2ClientCommand();
|
||||
}
|
||||
#endregion
|
||||
#region Open
|
||||
/// <summary>
|
||||
/// Open, per MSDN
|
||||
/// </summary>
|
||||
unsafe public void Open()
|
||||
{
|
||||
DB2ClientUtils util = new DB2ClientUtils();
|
||||
outConnectStr = new StringBuilder(60); //Set some initial size, we know we're gettig a chunk of data back
|
||||
IntPtr penvHandle=IntPtr.Zero;
|
||||
IntPtr numOutCharsReturned = IntPtr.Zero;
|
||||
short sqlRet=0;
|
||||
|
||||
try
|
||||
{
|
||||
sqlRet = DB2ClientPrototypes.SQLAllocHandle(DB2ClientConstants.SQL_HANDLE_ENV, IntPtr.Zero, ref penvHandle);
|
||||
util.DB2CheckReturn(sqlRet, 0, IntPtr.Zero, "Unable to allocate Environment handle in DB2ClientConnection.");
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLAllocHandle(DB2ClientConstants.SQL_HANDLE_DBC, penvHandle, ref dbHandle);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_ENV, penvHandle, "Unable to allocate database handle in DB2ClientConnection.");
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLDriverConnect(dbHandle, 0, connectionString,
|
||||
connectionString.Length, outConnectStr, 100, numOutCharsReturned,
|
||||
DB2ClientConstants.SQL_DRIVER_COMPLETE);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_ENV, penvHandle, "Unable to connect to the database.");
|
||||
|
||||
}
|
||||
catch (DB2ClientException DB2E)
|
||||
{
|
||||
Console.WriteLine(DB2E.Message);
|
||||
Dispose();
|
||||
throw DB2E;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Dispose
|
||||
/// <summary>
|
||||
/// Dispose
|
||||
/// </summary>
|
||||
unsafe public void Dispose()
|
||||
{
|
||||
if(!disposed)
|
||||
{
|
||||
this.Close();
|
||||
disposed = true;
|
||||
} else
|
||||
return;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void CheckState()
|
||||
{
|
||||
if (ConnectionState.Closed == State)
|
||||
throw new DB2ClientException ("Connection is currently closed.");
|
||||
}
|
||||
|
||||
void SetConnectionString (string connectionString)
|
||||
{
|
||||
this.connectionString = connectionString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
#region Licence
|
||||
/// DB2DriverCS - A DB2 driver for .Net
|
||||
/// Copyright 2003 By Christopher Bockner
|
||||
/// Released under the terms of the MIT/X11 Licence
|
||||
/// Please refer to the Licence.txt file that should be distributed with this package
|
||||
/// This software requires that DB2 client software be installed correctly on the machine
|
||||
/// (or instance) on which the driver is running.
|
||||
#endregion
|
||||
using System;
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for DB2Constants.
|
||||
/// </summary>
|
||||
public class DB2ClientConstants
|
||||
{
|
||||
public DB2ClientConstants()
|
||||
{
|
||||
//
|
||||
// TODO: Add constructor logic here
|
||||
//
|
||||
|
||||
}
|
||||
public const short SQL_HANDLE_ENV = 1;
|
||||
public const short SQL_HANDLE_DBC = 2;
|
||||
public const short SQL_HANDLE_STMT = 3;
|
||||
public const short SQL_HANDLE_DESC = 4;
|
||||
|
||||
/* RETCODE values */
|
||||
public const long SQL_SUCCESS = 0;
|
||||
public const long SQL_SUCCESS_WITH_INFO = 1;
|
||||
public const long SQL_NEED_DATA = 99;
|
||||
public const long SQL_NO_DATA = 100;
|
||||
public const long SQL_STILL_EXECUTING = 2;
|
||||
public const long SQL_ERROR = -1;
|
||||
public const long SQL_INVALID_HANDLE = -2;
|
||||
public const long SQL_NULL_HANDLE = 0L;
|
||||
public const short SQL_COMMIT = 0;
|
||||
public const short SQL_ROLLBACK = 1;
|
||||
public const short SQL_NO_DATA_FOUND = 100;
|
||||
|
||||
/* Isolation levels */
|
||||
public const long SQL_TXN_READ_UNCOMMITTED = 0x00000001L;
|
||||
public const long SQL_TXN_READ_COMMITTED = 0x00000002L;
|
||||
public const long SQL_TXN_REPEATABLE_READ = 0x00000004L;
|
||||
public const long SQL_TXN_SERIALIZABLE_READ = 0x00000008L;
|
||||
public const long SQL_TXN_NOCOMMIT = 0x00000020L;
|
||||
|
||||
/* Connect options */
|
||||
public const long SQL_TXN_ISOLATION = 108;
|
||||
public const long SQL_AUTOCOMMIT = 102;
|
||||
|
||||
public const long SQL_AUTOCOMMIT_OFF = 0L;
|
||||
public const long SQL_AUTOCOMMIT_ON = 1L;
|
||||
|
||||
/* Data Types */
|
||||
public const int SQL_CHAR = 1;
|
||||
public const int SQL_DECIMAL = 3;
|
||||
public const int SQL_VARCHAR = 12;
|
||||
public const int SQL_TYPE_DATE = 91;
|
||||
public const int SQL_TYPE_TIME = 92;
|
||||
public const int SQL_TYPE_TIMESTAMP = 93;
|
||||
|
||||
public const int SQL_C_CHAR = SQL_CHAR;
|
||||
|
||||
/* SQLDriverConnect Options */
|
||||
public const int SQL_DRIVER_NOPROMPT = 0;
|
||||
public const int SQL_DRIVER_COMPLETE = 1;
|
||||
public const int SQL_DRIVER_PROMPT = 2;
|
||||
public const int SQL_DRIVER_COMPLETE_REQUIRED = 3;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,458 @@
|
||||
#region Licence
|
||||
/// DB2DriverCS - A DB2 driver for .Net
|
||||
/// Copyright 2003 By Christopher Bockner
|
||||
/// Released under the terms of the MIT/X11 Licence
|
||||
/// Please refer to the Licence.txt file that should be distributed with this package
|
||||
/// This software requires that DB2 client software be installed correctly on the machine
|
||||
/// (or instance) on which the driver is running.
|
||||
#endregion
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for DB2ClientDataReader.
|
||||
/// DB2ClientDataReader.
|
||||
/// </summary>
|
||||
unsafe public class DB2ClientDataReader : IDataReader
|
||||
{
|
||||
internal DataTable rs; //Our result set is a datatable
|
||||
internal DB2ClientConnection db2Conn; //The connection we're working with
|
||||
internal IntPtr hwndStmt; //The statement handle returning the results
|
||||
private int row=-1; //Row pointer
|
||||
private int numCols=0;
|
||||
|
||||
#region Constructors and destructors
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="con"></Connection object to DB2>
|
||||
/// <param name="com"></Command object>
|
||||
internal DB2ClientDataReader(DB2ClientConnection con, DB2ClientCommand com)
|
||||
{
|
||||
db2Conn = con;
|
||||
hwndStmt = com.statementHandle; //We have access to the results through the statement handle
|
||||
|
||||
short sqlRet;
|
||||
StringBuilder colName = new StringBuilder(18);
|
||||
short colNameMaxLength=18;
|
||||
IntPtr colNameLength=IntPtr.Zero;
|
||||
IntPtr sqlDataType=IntPtr.Zero;
|
||||
IntPtr colSize=IntPtr.Zero;
|
||||
IntPtr scale=IntPtr.Zero;
|
||||
IntPtr nullable=IntPtr.Zero;
|
||||
DB2ClientUtils util = new DB2ClientUtils();
|
||||
rs = new DataTable();
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLNumResultCols(hwndStmt, ref numCols);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLNumResultCols");
|
||||
IntPtr[] dbVals = new IntPtr[numCols];
|
||||
IntPtr[] sqlLen_or_IndPtr = new IntPtr[numCols];
|
||||
for (ushort i=1; i<=numCols; i++)
|
||||
{
|
||||
sqlRet = DB2ClientPrototypes.SQLDescribeCol(hwndStmt, i, colName, colNameMaxLength, colNameLength, ref sqlDataType, ref colSize, ref scale, ref nullable);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLDescribeCol");
|
||||
///At this point I have the data type information as well, but for now I will insert the data as
|
||||
///Ansi strings and see how it goes. Maybe we can speed things up later...
|
||||
///
|
||||
rs.Columns.Add(colName.ToString());
|
||||
|
||||
sqlLen_or_IndPtr[i-1] = new IntPtr();
|
||||
dbVals[i-1] = Marshal.AllocHGlobal(colSize.ToInt32()+1);
|
||||
|
||||
try
|
||||
{
|
||||
switch (sqlDataType.ToInt32())
|
||||
{
|
||||
case DB2ClientConstants.SQL_DECIMAL: //These types are treated as SQL_C_CHAR for binding purposes
|
||||
case DB2ClientConstants.SQL_TYPE_DATE:
|
||||
case DB2ClientConstants.SQL_TYPE_TIME:
|
||||
case DB2ClientConstants.SQL_TYPE_TIMESTAMP:
|
||||
case DB2ClientConstants.SQL_VARCHAR:
|
||||
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, DB2ClientConstants.SQL_C_CHAR, dbVals[i-1],(short)colSize.ToInt32()+1, ref sqlLen_or_IndPtr[i-1]);
|
||||
break;
|
||||
default:
|
||||
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, (short)sqlDataType.ToInt32(), dbVals[i-1],(short)colSize.ToInt32()+1, ref sqlLen_or_IndPtr[i-1]);
|
||||
break;
|
||||
}
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLBindCol");
|
||||
}
|
||||
catch(DB2ClientException e)
|
||||
{
|
||||
System.Console.Write(e.Message);
|
||||
}
|
||||
isClosed = false;
|
||||
}
|
||||
sqlRet = DB2ClientPrototypes.SQLFetch(hwndStmt);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLFetch 1");
|
||||
while(sqlRet != DB2ClientConstants.SQL_NO_DATA_FOUND)
|
||||
{
|
||||
DataRow newRow = rs.NewRow();
|
||||
for (short y=1;y<=numCols;y++)
|
||||
{
|
||||
newRow[y-1] = Marshal.PtrToStringAnsi(dbVals[y-1]);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLFetch 2");
|
||||
}
|
||||
rs.Rows.Add(newRow);
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLFetch(hwndStmt);
|
||||
}
|
||||
for (int n=0;n<numCols;n++)
|
||||
Marshal.FreeHGlobal(dbVals[n]);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
#endregion
|
||||
#region Properties
|
||||
#region Depth property
|
||||
///
|
||||
///Depth of nesting for the current row, need to figure out what this translates into
|
||||
///with DB2.
|
||||
///
|
||||
private int depth = 0;
|
||||
public int Depth
|
||||
{
|
||||
get
|
||||
{
|
||||
return depth;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region IsClosed property
|
||||
/// <summary>
|
||||
/// True if the reader is closed.
|
||||
/// </summary>
|
||||
private bool isClosed = true;
|
||||
public bool IsClosed
|
||||
{
|
||||
get
|
||||
{
|
||||
return isClosed;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region RecordsAffected property
|
||||
///
|
||||
/// Number of records affected by this operation. Will be zero until we close the
|
||||
/// reader
|
||||
///
|
||||
private int recordsAffected = 0;
|
||||
public int RecordsAffected
|
||||
{
|
||||
get
|
||||
{
|
||||
return recordsAffected;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
#region Methods
|
||||
#region Close method
|
||||
///
|
||||
///
|
||||
public void Close()
|
||||
{
|
||||
if (rs != null)
|
||||
{
|
||||
recordsAffected = rs.Rows.Count;
|
||||
rs.Dispose();
|
||||
rs = null;
|
||||
isClosed=true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region GetSchemaTable
|
||||
///
|
||||
/// We'll return an empty table for now...ughh this one will be tedious to write
|
||||
///
|
||||
public DataTable GetSchemaTable()
|
||||
{
|
||||
throw new DB2ClientException ("TBD");
|
||||
}
|
||||
#endregion
|
||||
#region NextResult
|
||||
///
|
||||
/// Ummm is this related to SQLBulkOperations stuff..?
|
||||
///
|
||||
public bool NextResult()
|
||||
{
|
||||
throw new DB2ClientException("To be done");
|
||||
|
||||
//Deferring the meat of this until the batch stuff is implemented
|
||||
}
|
||||
#endregion
|
||||
#region Read
|
||||
///
|
||||
/// Apparently, this function does nothing other than tell you if you can move to the
|
||||
/// next row in the resultset. I have to move the fetching stuff elswhere...
|
||||
///
|
||||
public bool Read()
|
||||
{
|
||||
if (isClosed) return false;
|
||||
row++;
|
||||
//do something with the fetched data now...
|
||||
if(row < rs.Rows.Count)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region IDataRecord Interface
|
||||
///Code for the IDataRecord interface
|
||||
///
|
||||
#region FieldCount
|
||||
///
|
||||
///
|
||||
private int fieldCount = -1;
|
||||
public int FieldCount
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsClosed)
|
||||
fieldCount = 0;
|
||||
else
|
||||
fieldCount = rs.Columns.Count;
|
||||
return fieldCount;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Item accessors
|
||||
public object this[string name]
|
||||
{
|
||||
get
|
||||
{
|
||||
return rs.Rows[row][name];
|
||||
}
|
||||
}
|
||||
public object this[int col]
|
||||
{
|
||||
get
|
||||
{
|
||||
return rs.Rows[row][col];
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region GetBoolean method
|
||||
///
|
||||
///Use the Convert class for all of these returns
|
||||
///
|
||||
public bool GetBoolean(int col)
|
||||
{
|
||||
return Convert.ToBoolean(this[col]);
|
||||
}
|
||||
#endregion
|
||||
#region GetByte
|
||||
///
|
||||
///GetByte
|
||||
///
|
||||
public byte GetByte(int col)
|
||||
{
|
||||
return Convert.ToByte(this[col]);
|
||||
}
|
||||
#endregion
|
||||
#region GetBytes
|
||||
///
|
||||
/// GetBytes, return a stream of bytes
|
||||
///
|
||||
public long GetBytes(int col, long fieldOffset, byte[] buffer, int bufferOffset, int length)
|
||||
{
|
||||
//Hmm... How shall we deal with this one?
|
||||
return 0;
|
||||
}
|
||||
#endregion
|
||||
#region GetChar
|
||||
///
|
||||
///GetChar, return column as a char
|
||||
///
|
||||
public char GetChar(int col)
|
||||
{
|
||||
return Convert.ToChar(this[col]);
|
||||
}
|
||||
#endregion
|
||||
#region GetChars
|
||||
///
|
||||
///GetChars, returns char array
|
||||
///
|
||||
public long GetChars(int col, long fieldOffset, char[] buffer, int bufferOffset, int length)
|
||||
{
|
||||
//Again, not sure how I'll deal with this just yet
|
||||
return 0;
|
||||
}
|
||||
#endregion
|
||||
#region GetData
|
||||
///
|
||||
/// GetData method
|
||||
///
|
||||
public IDataReader GetData(int col)
|
||||
{
|
||||
//Have to research this one, not quite sure what the docs mean
|
||||
//DB2 does have some structured data types, is that what this is for?
|
||||
throw new DB2ClientException("Not yet supported.");
|
||||
}
|
||||
#endregion
|
||||
#region GetDataTypeName
|
||||
///
|
||||
///GetDataTypeName return the type of data
|
||||
///
|
||||
public string GetDataTypeName(int col)
|
||||
{
|
||||
//I could check the meta data as a starting point for this one, but until I implement
|
||||
//returning the result sets, I'm not exactly sure what info I'll have, so this function
|
||||
//waits until then...
|
||||
throw new DB2ClientException("Not yet implemented");
|
||||
}
|
||||
#endregion
|
||||
#region GetDateTime
|
||||
///
|
||||
/// GetDateTime method
|
||||
///
|
||||
public DateTime GetDateTime(int col)
|
||||
{
|
||||
return Convert.ToDateTime(this[col]);
|
||||
}
|
||||
#endregion
|
||||
#region GetDecimal
|
||||
///
|
||||
///GetDecimal method
|
||||
///
|
||||
public decimal GetDecimal(int col)
|
||||
{
|
||||
return Convert.ToDecimal(this[col]);
|
||||
}
|
||||
#endregion
|
||||
#region GetDouble
|
||||
///
|
||||
/// GetDouble
|
||||
///
|
||||
public double GetDouble(int col)
|
||||
{
|
||||
return Convert.ToDouble(this[col]);
|
||||
}
|
||||
#endregion
|
||||
#region GetFieldType
|
||||
///
|
||||
/// Type GetFieldType
|
||||
///
|
||||
public Type GetFieldType(int col)
|
||||
{
|
||||
//Again need more research here
|
||||
return typeof(int);
|
||||
}
|
||||
#endregion
|
||||
#region GetFloat
|
||||
///
|
||||
/// GetFloat
|
||||
///
|
||||
public float GetFloat(int col)
|
||||
{
|
||||
return (float) Convert.ToDouble(this[col].ToString(),new CultureInfo("en-US").NumberFormat);
|
||||
}
|
||||
#endregion
|
||||
#region GetGuid
|
||||
///
|
||||
/// GetGuid
|
||||
///
|
||||
public Guid GetGuid(int col)
|
||||
{
|
||||
// a Guid is a 128 bit unique value. Could be like a GENERATE UNIQUE in DB2
|
||||
// as usual, need more research
|
||||
throw new DB2ClientException("TBD");
|
||||
}
|
||||
#endregion
|
||||
#region The GetInt?? series
|
||||
///
|
||||
///GetInt16
|
||||
///
|
||||
public short GetInt16(int col)
|
||||
{
|
||||
return Convert.ToInt16(this[col]);
|
||||
}
|
||||
///
|
||||
///GetInt32
|
||||
///
|
||||
public int GetInt32(int col)
|
||||
{
|
||||
return Convert.ToInt32(this[col]);
|
||||
}
|
||||
///
|
||||
///GetInt64
|
||||
///
|
||||
public long GetInt64(int col)
|
||||
{
|
||||
return Convert.ToInt64(this[col]);
|
||||
}
|
||||
#endregion
|
||||
#region GetName
|
||||
///
|
||||
///GetName, returns the name of the field
|
||||
///
|
||||
public string GetName(int col)
|
||||
{
|
||||
return (rs.Columns[col].ColumnName);
|
||||
}
|
||||
#endregion
|
||||
#region GetOrdinal
|
||||
///
|
||||
/// GetOrdinal, return the index of the named column
|
||||
///
|
||||
public int GetOrdinal(string name)
|
||||
{
|
||||
return rs.Columns[name].Ordinal;
|
||||
}
|
||||
#endregion
|
||||
#region GetString
|
||||
///
|
||||
/// GetString returns a string
|
||||
///
|
||||
public string GetString(int col)
|
||||
{
|
||||
return Convert.ToString(this[col]);
|
||||
}
|
||||
#endregion
|
||||
#region GetValue
|
||||
///
|
||||
/// GetVCalue, returns an object
|
||||
///
|
||||
public object GetValue(int col)
|
||||
{
|
||||
return this[col];
|
||||
}
|
||||
#endregion
|
||||
#region GetValues
|
||||
///
|
||||
/// GetValues returns all columns in the row through the argument, and the number of columns in the return value
|
||||
///
|
||||
public int GetValues(object[] values)
|
||||
{
|
||||
int numCols = FieldCount;
|
||||
if (values.Length<numCols)
|
||||
throw new DB2ClientException("GetValues argument too small for number of columns in row.");
|
||||
for (int i = 0; i<=numCols; i++)
|
||||
values[i] = this[i];
|
||||
return numCols;
|
||||
}
|
||||
#endregion
|
||||
#region IsDBNull
|
||||
///
|
||||
/// IsDBNull Is the column null
|
||||
///
|
||||
public bool IsDBNull(int col)
|
||||
{
|
||||
//Proper implementation once I get the SQLDescribe/SQLBind/SQLFetch stuff in place
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion ///For IDataRecord
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
#region Licence
|
||||
/// DB2DriverCS - A DB2 driver for .Net
|
||||
/// Copyright 2003 By Christopher Bockner
|
||||
/// Released under the terms of the MIT/X11 Licence
|
||||
/// Please refer to the Licence.txt file that should be distributed with this package
|
||||
/// This software requires that DB2 client software be installed correctly on the machine
|
||||
/// (or instance) on which the driver is running.
|
||||
#endregion
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
/// <summary>
|
||||
/// Exception class. We will throw our own exception in the case of SQL_ERROR returns
|
||||
/// and call SQLGetDiagRec to get the error info.
|
||||
/// </summary>
|
||||
public class DB2ClientException : Exception
|
||||
{
|
||||
internal string message;
|
||||
public DB2ClientException(string Message)
|
||||
{
|
||||
this.message = Message;
|
||||
}
|
||||
unsafe public DB2ClientException(short sqlHandleType, IntPtr sqlHandle, string Message)
|
||||
{
|
||||
StringBuilder sqlState = new StringBuilder(50);
|
||||
StringBuilder errorMessage = new StringBuilder(1025);
|
||||
|
||||
int sqlReturn;
|
||||
short recNum=1;
|
||||
short bufLength = 1025;
|
||||
|
||||
IntPtr textLengthPtr = IntPtr.Zero;
|
||||
IntPtr nativeErrorPtr = IntPtr.Zero;
|
||||
|
||||
sqlReturn = DB2ClientPrototypes.SQLGetDiagRec(sqlHandleType, sqlHandle, recNum, sqlState, ref nativeErrorPtr, errorMessage, bufLength, ref textLengthPtr);
|
||||
this.message = Message + "\n" + sqlState.ToString() + " " + errorMessage.ToString()+"\n";
|
||||
//See if there are more errors to retrieve and get them.
|
||||
while (sqlReturn != DB2ClientConstants.SQL_NO_DATA && sqlReturn > 0)
|
||||
{
|
||||
recNum++;
|
||||
sqlReturn = DB2ClientPrototypes.SQLGetDiagRec(sqlHandleType, sqlHandle, recNum, sqlState, ref nativeErrorPtr, errorMessage, bufLength, ref textLengthPtr);
|
||||
this.message += "\n" + sqlState.ToString() + " " + errorMessage.ToString()+"\n";
|
||||
}
|
||||
|
||||
}
|
||||
public override string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.message;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
#region Licence
|
||||
/// DB2DriverCS - A DB2 driver for .Net
|
||||
/// Copyright 2003 By Christopher Bockner
|
||||
/// Released under the terms of the MIT/X11 Licence
|
||||
/// Please refer to the Licence.txt file that should be distributed with this package
|
||||
/// This software requires that DB2 client software be installed correctly on the machine
|
||||
/// (or instance) on which the driver is running.
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
/// <summary>
|
||||
/// DB2CLIPrototypes class is a wrapper for the db2cli.lib, IBM's Call Level Interface to DB2
|
||||
/// </summary>
|
||||
unsafe internal class DB2ClientPrototypes
|
||||
{
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLAllocHandle")]
|
||||
unsafe public static extern short SQLAllocHandle(short handleType, IntPtr inputHandle, ref IntPtr outputHandle);
|
||||
[DllImport("db2cli.Dll", EntryPoint = "SQLConnect")]
|
||||
unsafe public static extern short SQLConnect(IntPtr sqlHdbc, string serverName, short serverNameLength, string userName, short userNameLength, string authentication, short authenticationLength);
|
||||
[DllImport("db2cli.Dll", CharSet = CharSet.Auto, EntryPoint = "SQLDisconnect")]
|
||||
unsafe public static extern short SQLDisconnect(IntPtr sqlHdbc);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLGetDiagRec")]
|
||||
unsafe public static extern short SQLGetDiagRec( short handleType, IntPtr handle, short recNum, [Out] StringBuilder sqlState, ref IntPtr nativeErrorPtr, [Out] StringBuilder errorMessage, short bufferLength, ref IntPtr shortTextLengthPtr);
|
||||
[DllImport("db2cli.Dll", EntryPoint = "SQLSetConnectAttr")]
|
||||
unsafe public static extern short SQLSetConnectAttr(IntPtr sqlHdbc, long sqlAttr, IntPtr sqlValuePtr, long sqlStrLength);
|
||||
[DllImport("db2cli.Dll", EntryPoint = "SQLEndTran")]
|
||||
unsafe public static extern short SQLEndTran (short handleType, IntPtr handle, short fType);
|
||||
[DllImport("db2cli.Dll", EntryPoint = "SQLCancel")]
|
||||
unsafe public static extern short SQLCancel(IntPtr handle);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLNumResultCols")]
|
||||
unsafe public static extern short SQLNumResultCols(IntPtr handle, ref int numCols);
|
||||
[DllImport("db2cli.Dll", EntryPoint = "SQLFetch")]
|
||||
unsafe public static extern short SQLFetch(IntPtr handle);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLRowCount")]
|
||||
unsafe public static extern short SQLRowCount(IntPtr stmtHandle, ref int numRows);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLExecute")]
|
||||
unsafe public static extern short SQLExecute(IntPtr handle);
|
||||
[DllImport ("db2cli.dll", EntryPoint = "SQLExecDirect")]
|
||||
unsafe public static extern short SQLExecDirect(IntPtr stmtHandle, string stmt, int length);
|
||||
[DllImport("db2cli.Dll", EntryPoint = "SQLDescribeCol")]
|
||||
unsafe public static extern short SQLDescribeCol(IntPtr stmtHandle, ushort colNum, [Out] StringBuilder colName, short colNameMaxLength, IntPtr colNameLength, ref IntPtr dataType, ref IntPtr colSizePtr, ref IntPtr scalePtr, ref IntPtr nullablePtr );
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLBindCol")]
|
||||
unsafe public static extern short SQLBindCol(IntPtr stmtHandle, ushort colNum, int dataType,[In][Out] IntPtr dataBufferPtr, int dataBufferLength, ref IntPtr StrLen_or_IndPtr);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLDriverConnect")]
|
||||
unsafe public static extern short SQLDriverConnect(IntPtr hdbc, int centered, [In] string inConnectStr, [In] int inStrLength, [Out] StringBuilder outConnectStr, [Out] int outStrCapacity, [Out] IntPtr outStrLengthReturned, [In] int completion);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
#region Licence
|
||||
/// DB2DriverCS - A DB2 driver for .Net
|
||||
/// Copyright 2003 By Christopher Bockner
|
||||
/// Released under the terms of the MIT/X11 Licence
|
||||
/// Please refer to the Licence.txt file that should be distributed with this package
|
||||
/// This software requires that DB2 client software be installed correctly on the machine
|
||||
/// (or instance) on which the driver is running.
|
||||
#endregion
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
/// <summary>
|
||||
/// DB2ClientTransaction. DB2 requires nothing specific to be done to open a transaction, so we set the
|
||||
/// isolation level, make sure AUTOCOMMIT is off. DB2 Also allows you to set transaction isolation
|
||||
/// at the statement level, but I haven't worked that in here yet.
|
||||
/// </summary>
|
||||
public class DB2ClientTransaction : IDbTransaction
|
||||
{
|
||||
IsolationLevel IL = IsolationLevel.Unspecified;
|
||||
DB2ClientConnection db2Conn;
|
||||
public DB2ClientTransaction(DB2ClientConnection con, IsolationLevel isoL)
|
||||
{
|
||||
IL = isoL;
|
||||
long db2IsoL = DB2ClientConstants.SQL_TXN_READ_COMMITTED;
|
||||
db2Conn = con;
|
||||
short sqlRet;
|
||||
|
||||
switch (isoL)
|
||||
{
|
||||
case System.Data.IsolationLevel.Chaos:
|
||||
break;
|
||||
case System.Data.IsolationLevel.ReadCommitted: //SQL_TXN_READ_COMMITTED
|
||||
db2IsoL = DB2ClientConstants.SQL_TXN_READ_COMMITTED;
|
||||
break;
|
||||
case System.Data.IsolationLevel.ReadUncommitted: //SQL_TXN_READ_UNCOMMITTED
|
||||
db2IsoL = DB2ClientConstants.SQL_TXN_READ_UNCOMMITTED;
|
||||
break;
|
||||
case System.Data.IsolationLevel.RepeatableRead: //SQL_TXN_REPEATABLE_READ
|
||||
db2IsoL = DB2ClientConstants.SQL_TXN_REPEATABLE_READ;
|
||||
break;
|
||||
case System.Data.IsolationLevel.Serializable: //SQL_TXN_SERIALIZABLE_READ
|
||||
db2IsoL = DB2ClientConstants.SQL_TXN_SERIALIZABLE_READ;
|
||||
break;
|
||||
}
|
||||
|
||||
IntPtr iso = new IntPtr(db2IsoL);
|
||||
IntPtr attr = new IntPtr(DB2ClientConstants.SQL_AUTOCOMMIT_OFF);
|
||||
sqlRet = DB2ClientPrototypes.SQLSetConnectAttr(db2Conn.DBHandle, DB2ClientConstants.SQL_AUTOCOMMIT, attr, 0);
|
||||
sqlRet = DB2ClientPrototypes.SQLSetConnectAttr(db2Conn.DBHandle, DB2ClientConstants.SQL_TXN_ISOLATION, iso, 0);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DB2ClientConnection associated with this transaction
|
||||
/// </summary>
|
||||
public IDbConnection Connection
|
||||
{
|
||||
get
|
||||
{
|
||||
return db2Conn;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// IsolationLevel property
|
||||
/// </summary>
|
||||
///
|
||||
public IsolationLevel IsolationLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
return IL;
|
||||
}
|
||||
}
|
||||
|
||||
public void Commit() {
|
||||
DB2ClientPrototypes.SQLEndTran(DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, DB2ClientConstants.SQL_COMMIT);
|
||||
}
|
||||
public void Rollback()
|
||||
{
|
||||
DB2ClientPrototypes.SQLEndTran(DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, DB2ClientConstants.SQL_ROLLBACK);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose method.
|
||||
/// </summary>
|
||||
private bool Done = false;
|
||||
public void Dispose()
|
||||
{
|
||||
if (Done)
|
||||
return;
|
||||
Rollback();
|
||||
IL = IsolationLevel.Unspecified;
|
||||
db2Conn = null;
|
||||
Done = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
#region Licence
|
||||
/// DB2DriverCS - A DB2 driver for .Net
|
||||
/// Copyright 2003 By Christopher Bockner
|
||||
/// Released under the terms of the MIT/X11 Licence
|
||||
/// Please refer to the Licence.txt file that should be distributed with this package
|
||||
/// This software requires that DB2 client software be installed correctly on the machine
|
||||
/// (or instance) on which the driver is running.
|
||||
#endregion
|
||||
using System;
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
/// <summary>
|
||||
/// Utility functions class, i.e. functions like SQL return code error checking
|
||||
/// </summary>
|
||||
public class DB2ClientUtils
|
||||
{
|
||||
public DB2ClientUtils()
|
||||
{
|
||||
//
|
||||
// TODO: Add constructor logic here
|
||||
//
|
||||
}
|
||||
#region DB2CheckReturn
|
||||
/// <summary>
|
||||
/// Check the return value from a Call Level Interface call and respond to errors (by tossing exception)
|
||||
/// </summary>
|
||||
/// <param name="sqlRet"><The return value>
|
||||
/// <param name="handleType"><Type of handle, 0 means we don't care, so don't try to check the handle for any messages placed there by DB2>
|
||||
/// <param name="handle"><The handle in question, don't care if handletype is 0>
|
||||
/// <param name="message"><Message we may throw>
|
||||
/// <returns></returns>
|
||||
public int DB2CheckReturn(short sqlRet, short handleType, IntPtr handle, string message)
|
||||
{
|
||||
switch ((long)sqlRet)
|
||||
{
|
||||
case DB2ClientConstants.SQL_ERROR:
|
||||
if (handleType != 0)
|
||||
throw new DB2ClientException(handleType, handle, message);
|
||||
else
|
||||
throw new DB2ClientException(message);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,58 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified, the assembly is not signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine. KeyFile refers to a file which contains
|
||||
// a key.
|
||||
// (*) If the KeyFile and the KeyName values are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP, that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the KeyFile is installed into the CSP and used.
|
||||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
|
||||
// When specifying the KeyFile, the location of the KeyFile should be
|
||||
// relative to the project output directory which is
|
||||
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
|
||||
// located in the project directory, you would specify the AssemblyKeyFile
|
||||
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
||||
@@ -0,0 +1,6 @@
|
||||
2003-01-18 Daniel Morgan <[email protected]>
|
||||
|
||||
* TestDB2Conn.cs: use a different connection string
|
||||
which uses the format
|
||||
"DSN=database;UID=userid;PWD=password"
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
#region Licence
|
||||
/// DB2DriverCS Test Code - A DB2 driver test for .Net
|
||||
/// Copyright 2003 By Christopher Bockner
|
||||
/// Released under the terms of the MIT/X11 Licence
|
||||
/// Please refer to the Licence.txt file that should be distributed with this package
|
||||
/// This software requires that DB2 client software be installed correctly on the machine
|
||||
/// (or instance) on which the driver is running.
|
||||
///
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using DB2ClientCS;
|
||||
using System.Text;
|
||||
|
||||
namespace TestDB2Conn {
|
||||
/// <summary>
|
||||
/// Code to test DB2DriverCS.
|
||||
/// </summary>
|
||||
class TestDB2Client
|
||||
{
|
||||
static void DoTest(string database, string userid, string password)
|
||||
{
|
||||
IDbCommand command = null;
|
||||
string connectionString = String.Format(
|
||||
"DSN={0};UID={1};PWD={2}",
|
||||
database, userid, password);
|
||||
try {
|
||||
Console.WriteLine("Create DB2 client Connection...");
|
||||
DB2ClientConnection DB2Conn = new DB2ClientConnection();
|
||||
|
||||
Console.WriteLine("connection string: " + connectionString);
|
||||
|
||||
Console.WriteLine("Set connection string...");
|
||||
DB2Conn.ConnectionString = connectionString;
|
||||
|
||||
Console.WriteLine("Open a connection...");
|
||||
DB2Conn.Open();
|
||||
|
||||
string createTestTableSQL =
|
||||
"CREATE TABLE mono_db2_test1 ( " +
|
||||
" testid varchar(2), " +
|
||||
" testdesc varchar(16) " +
|
||||
")";
|
||||
Console.WriteLine("SQL:\n" + createTestTableSQL);
|
||||
|
||||
Console.WriteLine("Create a command using sql and connection...");
|
||||
command = new DB2ClientCommand(createTestTableSQL,DB2Conn);
|
||||
Console.WriteLine("Execute Non Query...");
|
||||
command.ExecuteNonQuery();
|
||||
|
||||
string selectSQL = "select * from employee";
|
||||
Console.WriteLine("SQL:\n" + selectSQL);
|
||||
Console.WriteLine("create command and set connection and connection string...");
|
||||
command = new DB2ClientCommand(selectSQL,DB2Conn);
|
||||
Console.WriteLine("ExecuteReader...");
|
||||
IDataReader dr = command.ExecuteReader();
|
||||
Console.WriteLine("Read row...");
|
||||
dr.Read();
|
||||
Console.WriteLine("Read row...");
|
||||
dr.Read();
|
||||
Console.WriteLine("GetString...");
|
||||
string dt = dr.GetString(1);
|
||||
Console.WriteLine("dt: " + dt);
|
||||
string s = dr.GetString(5);
|
||||
Console.WriteLine("s: " + s);
|
||||
DateTime t = dr.GetDateTime(6);
|
||||
Console.WriteLine("t: " + t);
|
||||
|
||||
Console.WriteLine("Close connection...");
|
||||
DB2Conn.Close();
|
||||
}
|
||||
catch(DB2ClientException e) {
|
||||
System.Console.Write(e.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
if(args.Length != 3)
|
||||
Console.WriteLine("Usage: mono TestDB2Conn.exe database userid password");
|
||||
else {
|
||||
Console.WriteLine("Test Begin.");
|
||||
// database, userid, password
|
||||
DoTest(args[0], args[1], args[2]);
|
||||
Console.WriteLine("Test End.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
Copyright (c) 2003 Christopher Bockner
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Mono.Data.Db2Client/AssemblyInfo.cs
|
||||
Mono.Data.Db2Client/DB2ClientCommand.cs
|
||||
Mono.Data.Db2Client/DB2ClientConnection.cs
|
||||
Mono.Data.Db2Client/DB2ClientConstants.cs
|
||||
Mono.Data.Db2Client/DB2ClientDataReader.cs
|
||||
Mono.Data.Db2Client/DB2ClientException.cs
|
||||
Mono.Data.Db2Client/DB2ClientPrototypes.cs
|
||||
Mono.Data.Db2Client/DB2ClientTransaction.cs
|
||||
Mono.Data.Db2Client/DB2ClientUtils.cs
|
||||
@@ -0,0 +1,12 @@
|
||||
topdir = ../..
|
||||
|
||||
LIBRARY = $(topdir)/class/lib/Mono.Data.DB2Client.dll
|
||||
|
||||
LIB_LIST = list
|
||||
LIB_FLAGS = --unsafe -r corlib -r System -r System.Xml -r System.Data
|
||||
|
||||
SOURCES_INCLUDE=*.cs
|
||||
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include $(topdir)/class/library.make
|
||||
@@ -1,3 +1,7 @@
|
||||
2003-01-20 Duncan Mak <[email protected]>
|
||||
|
||||
* list.unix: Remove the extra reference to ArgumentProcessorAttribute.cs
|
||||
|
||||
2002-09-03 Rafael Teixeira <[email protected]>
|
||||
|
||||
* added AboutAttribute.cs, AuthorAttribute.cs, OptionAttribute.cs,
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2003-01-17 Daniel Morgan <[email protected]>
|
||||
|
||||
* System.Data.SqlClient.SqlConnection.cs: add connection
|
||||
parameter UID which is the same thing as User ID
|
||||
|
||||
2003-01-13 Ville Palo <[email protected]>
|
||||
|
||||
* System.Xml/XmlDataDocument.cs: lots of bugfixes and more implemented
|
||||
methods.
|
||||
|
||||
2003-01-08 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* list: added System.Data/DataTablePropertyDescriptor.cs
|
||||
|
||||
@@ -518,6 +518,7 @@ namespace System.Data.SqlClient {
|
||||
case "POOLING" :
|
||||
pooling = !(value.ToUpper ().Equals ("FALSE") || value.ToUpper ().Equals ("NO"));
|
||||
break;
|
||||
case "UID" :
|
||||
case "USER ID" :
|
||||
parms.User = value;
|
||||
break;
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
2003-01-18 Ville Palo <[email protected]>
|
||||
|
||||
* DataTableCollection.cs: Now names new DataTable if it doesn't
|
||||
already have a name.
|
||||
|
||||
2003-01-17 Ville Palo <[email protected]>
|
||||
|
||||
* XmlSchemaMapper.cs: Improvments.
|
||||
* XmlConstaints.cs: Added more constants.
|
||||
* DataSet.cs: Improvments of reading and writing xml
|
||||
* DataColumn.cs: Added default values of properties.
|
||||
|
||||
2003-01-14 Ville Palo <[email protected]>
|
||||
|
||||
* XmlSchemaMapper.cs: Some improvments
|
||||
|
||||
2003-01-13 Ville Palo <[email protected]>
|
||||
|
||||
* DataRowCollection.cs: Added IndexOutOfRangeException
|
||||
* DataTableCollection.cs: Added OnCollectionChanging and
|
||||
OnCollectionChanged events.
|
||||
* DataSet.cs: Many fixes. Implemented Clone () and Copy () -methods
|
||||
* DataTable.cs: Implemented Copy () and Clone () methods.
|
||||
* XmlDataLoader.cs: some fixes.
|
||||
* XmlSchemaMapper.cs: comments.
|
||||
|
||||
2003-01-08 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* DataColumnPropertyDescriptor.cs: store columnIndex in the .ctor.
|
||||
|
||||
@@ -50,14 +50,14 @@ namespace System.Data {
|
||||
private string _caption = null;
|
||||
private MappingType _columnMapping = MappingType.Element;
|
||||
private string _columnName = null;
|
||||
private Type _dataType = null;
|
||||
private object _defaultValue = null;
|
||||
private string expression = null;
|
||||
private Type _dataType = Type.GetType ("System.String");
|
||||
private object _defaultValue = DBNull.Value;
|
||||
private string expression = "";
|
||||
private PropertyCollection _extendedProperties = new PropertyCollection ();
|
||||
private int maxLength = -1; //-1 represents no length limit
|
||||
private string nameSpace = null;
|
||||
private string nameSpace = "";
|
||||
private int _ordinal = -1; //-1 represents not part of a collection
|
||||
private string prefix = null;
|
||||
private string prefix = "";
|
||||
private bool readOnly = false;
|
||||
private DataTable _table = null;
|
||||
private bool unique = false;
|
||||
|
||||
@@ -37,7 +37,12 @@ namespace System.Data
|
||||
/// </summary>
|
||||
public DataRow this[int index]
|
||||
{
|
||||
get { return (DataRow) list[index]; }
|
||||
get {
|
||||
if (index >= Count)
|
||||
throw new IndexOutOfRangeException ("There is no row at position " + index + ".");
|
||||
|
||||
return (DataRow) list[index];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -17,6 +17,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Xml;
|
||||
@@ -31,7 +32,7 @@ namespace System.Data {
|
||||
public class DataSet : MarshalByValueComponent, IListSource,
|
||||
ISupportInitialize, ISerializable {
|
||||
|
||||
private string dataSetName;
|
||||
private string dataSetName = "NewDataSet";
|
||||
private string _namespace = "";
|
||||
private string prefix;
|
||||
private bool caseSensitive;
|
||||
@@ -202,12 +203,47 @@ namespace System.Data {
|
||||
|
||||
public virtual DataSet Clone()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
DataSet Copy = new DataSet ();
|
||||
CopyProperties (Copy);
|
||||
|
||||
foreach (DataTable Table in Tables) {
|
||||
Copy.Tables.Add (Table.Clone ());
|
||||
}
|
||||
|
||||
return Copy;
|
||||
}
|
||||
|
||||
// Copies both the structure and data for this DataSet.
|
||||
public DataSet Copy()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
DataSet Copy = new DataSet ();
|
||||
CopyProperties (Copy);
|
||||
|
||||
// Copy DatSet's tables
|
||||
foreach (DataTable Table in Tables) {
|
||||
Copy.Tables.Add (Table.Copy ());
|
||||
}
|
||||
|
||||
return Copy;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private void CopyProperties (DataSet Copy)
|
||||
{
|
||||
Copy.CaseSensitive = CaseSensitive;
|
||||
//Copy.Container = Container
|
||||
Copy.DataSetName = DataSetName;
|
||||
//Copy.DefaultViewManager
|
||||
//Copy.DesignMode
|
||||
Copy.EnforceConstraints = EnforceConstraints;
|
||||
//Copy.ExtendedProperties
|
||||
//Copy.HasErrors
|
||||
//Copy.Locale = Locale;
|
||||
Copy.Namespace = Namespace;
|
||||
Copy.Prefix = Prefix;
|
||||
//Copy.Relations = Relations;
|
||||
//Copy.Site = Site;
|
||||
|
||||
}
|
||||
|
||||
public DataSet GetChanges()
|
||||
@@ -223,12 +259,16 @@ namespace System.Data {
|
||||
|
||||
public string GetXml()
|
||||
{
|
||||
return "Fish!";
|
||||
StringWriter Writer = new StringWriter ();
|
||||
WriteXml (Writer, XmlWriteMode.IgnoreSchema);
|
||||
return Writer.ToString ();
|
||||
}
|
||||
|
||||
public string GetXmlSchema()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
StringWriter Writer = new StringWriter ();
|
||||
WriteXmlSchema (Writer);
|
||||
return Writer.ToString ();
|
||||
}
|
||||
|
||||
public virtual void RejectChanges()
|
||||
@@ -269,7 +309,6 @@ namespace System.Data {
|
||||
public void WriteXml(XmlWriter writer)
|
||||
{
|
||||
WriteXml( writer, XmlWriteMode.IgnoreSchema );
|
||||
writer.Close ();
|
||||
}
|
||||
|
||||
public void WriteXml(Stream stream, XmlWriteMode mode)
|
||||
@@ -329,7 +368,6 @@ namespace System.Data {
|
||||
writer.WriteEndElement();
|
||||
|
||||
writer.WriteEndDocument();
|
||||
writer.Close ();
|
||||
}
|
||||
|
||||
public void WriteXmlSchema(Stream stream)
|
||||
@@ -363,7 +401,6 @@ namespace System.Data {
|
||||
DoWriteXmlSchema( writer );
|
||||
|
||||
writer.WriteEndDocument();
|
||||
writer.Close ();
|
||||
}
|
||||
|
||||
public void ReadXmlSchema(Stream stream)
|
||||
@@ -388,7 +425,6 @@ namespace System.Data {
|
||||
{
|
||||
XmlSchemaMapper SchemaMapper = new XmlSchemaMapper (this);
|
||||
SchemaMapper.Read (reader);
|
||||
reader.Close ();
|
||||
}
|
||||
|
||||
public XmlReadMode ReadXml (Stream stream)
|
||||
@@ -409,9 +445,32 @@ namespace System.Data {
|
||||
public XmlReadMode ReadXml (XmlReader r)
|
||||
{
|
||||
XmlDataLoader Loader = new XmlDataLoader (this);
|
||||
XmlReadMode Result = Loader.LoadData (r);
|
||||
r.Close ();
|
||||
return Result;
|
||||
// FIXME: somekinda exception?
|
||||
if (!r.Read ())
|
||||
return XmlReadMode.Auto; // FIXME
|
||||
|
||||
/*\
|
||||
* If document is diffgram we will use diffgram
|
||||
\*/
|
||||
if (r.LocalName == "diffgram")
|
||||
return ReadXml (r, XmlReadMode.DiffGram);
|
||||
|
||||
/*\
|
||||
* If we already have a schema, or the document
|
||||
* contains an in-line schema, sets XmlReadMode to ReadSchema.
|
||||
\*/
|
||||
|
||||
// FIXME: is this always true: "if we have tables we have to have schema also"
|
||||
if (Tables.Count > 0)
|
||||
return ReadXml (r, XmlReadMode.ReadSchema);
|
||||
|
||||
/*\
|
||||
* If we dont have a schema yet and document
|
||||
* contains no inline-schema mode is XmlReadMode.InferSchema
|
||||
\*/
|
||||
|
||||
return ReadXml (r, XmlReadMode.InferSchema);
|
||||
|
||||
}
|
||||
|
||||
public XmlReadMode ReadXml (Stream stream, XmlReadMode mode)
|
||||
@@ -432,8 +491,19 @@ namespace System.Data {
|
||||
[MonoTODO]
|
||||
public XmlReadMode ReadXml (XmlReader reader, XmlReadMode mode)
|
||||
{
|
||||
XmlDataLoader Loader = new XmlDataLoader (this);
|
||||
return Loader.LoadData (reader, mode);
|
||||
XmlReadMode Result = XmlReadMode.Auto;
|
||||
|
||||
if (mode == XmlReadMode.DiffGram) {
|
||||
XmlDiffLoader DiffLoader = new XmlDiffLoader (this);
|
||||
DiffLoader.Load (reader);
|
||||
Result = XmlReadMode.DiffGram;
|
||||
}
|
||||
else {
|
||||
XmlDataLoader Loader = new XmlDataLoader (this);
|
||||
Result = Loader.LoadData (reader, mode);
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
#endregion // Public Methods
|
||||
@@ -495,14 +565,30 @@ namespace System.Data {
|
||||
System.Collections.ArrayList atts;
|
||||
System.Collections.ArrayList elements;
|
||||
DataColumn simple = null;
|
||||
|
||||
|
||||
SplitColumns( table, out atts, out elements, out simple );
|
||||
|
||||
|
||||
foreach( DataRow row in table.Rows )
|
||||
{
|
||||
//sort out the namespacing
|
||||
string nspc = table.Namespace.Length > 0 ? table.Namespace : Namespace;
|
||||
|
||||
// First check are all the rows null. If they are we just write empty element
|
||||
bool AllNulls = true;
|
||||
foreach (DataColumn dc in table.Columns) {
|
||||
|
||||
if (row [dc.ColumnName] != DBNull.Value) {
|
||||
AllNulls = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If all of the columns were null, we have to write empty element
|
||||
if (AllNulls) {
|
||||
writer.WriteElementString (table.TableName, "");
|
||||
continue;
|
||||
}
|
||||
|
||||
WriteStartElement( writer, mode, nspc, table.Prefix, table.TableName );
|
||||
|
||||
foreach( DataColumn col in atts )
|
||||
@@ -540,6 +626,7 @@ namespace System.Data {
|
||||
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void WriteStartElement( XmlWriter writer, XmlWriteMode mode, string nspc, string prefix, string name )
|
||||
@@ -586,11 +673,8 @@ namespace System.Data {
|
||||
private void DoWriteXmlSchema( XmlWriter writer )
|
||||
{
|
||||
//Create the root element and declare all the namespaces etc
|
||||
writer.WriteStartElement( XmlConstants.SchemaPrefix,
|
||||
XmlConstants.SchemaElement,
|
||||
writer.WriteStartElement(XmlConstants.SchemaPrefix, XmlConstants.SchemaElement,
|
||||
XmlConstants.SchemaNamespace );
|
||||
|
||||
writer.WriteAttributeString( XmlConstants.Id, DataSetName );
|
||||
writer.WriteAttributeString( XmlConstants.TargetNamespace, Namespace );
|
||||
writer.WriteAttributeString( "xmlns:" + XmlConstants.TnsPrefix, Namespace );
|
||||
writer.WriteAttributeString( "xmlns", Namespace );
|
||||
@@ -616,7 +700,8 @@ namespace System.Data {
|
||||
writer.WriteAttributeString( XmlConstants.Name, DataSetName );
|
||||
writer.WriteAttributeString( XmlConstants.MsdataPrefix, XmlConstants.IsDataSet, XmlConstants.MsdataNamespace, "true" );
|
||||
//FIXME - sort out the locale string!
|
||||
writer.WriteAttributeString( XmlConstants.MsdataPrefix, XmlConstants.Locale, XmlConstants.MsdataNamespace, "en-us" );
|
||||
|
||||
writer.WriteAttributeString( XmlConstants.MsdataPrefix, XmlConstants.Locale, XmlConstants.MsdataNamespace, Thread.CurrentThread.CurrentCulture.Name);
|
||||
|
||||
//<xs:complexType>
|
||||
writer.WriteStartElement( XmlConstants.SchemaPrefix,
|
||||
@@ -665,6 +750,7 @@ namespace System.Data {
|
||||
//</xs:element>
|
||||
writer.WriteEndElement();
|
||||
|
||||
|
||||
//</schema>
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
@@ -691,7 +777,7 @@ namespace System.Data {
|
||||
|
||||
//TODO - what about the simple content?
|
||||
if( elements.Count == 0 )
|
||||
{
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -708,16 +794,33 @@ namespace System.Data {
|
||||
XmlConstants.SchemaNamespace );
|
||||
|
||||
writer.WriteAttributeString( XmlConstants.Name, col.ColumnName );
|
||||
|
||||
if (col.ColumnName != col.Caption && col.Caption != string.Empty)
|
||||
writer.WriteAttributeString( XmlConstants.MsdataPrefix, XmlConstants.Caption,
|
||||
XmlConstants.MsdataNamespace, col.Caption);
|
||||
|
||||
if (col.DefaultValue.ToString () != string.Empty)
|
||||
writer.WriteAttributeString( XmlConstants.Default, col.DefaultValue.ToString ());
|
||||
|
||||
writer.WriteAttributeString( XmlConstants.Type, MapType( col.DataType ) );
|
||||
|
||||
if( col.AllowDBNull )
|
||||
{
|
||||
writer.WriteAttributeString( XmlConstants.MinOccurs, "0" );
|
||||
}
|
||||
writer.WriteAttributeString( XmlConstants.MsdataPrefix,
|
||||
XmlConstants.Ordinal,
|
||||
XmlConstants.MsdataNamespace,
|
||||
col.Ordinal.ToString() );
|
||||
|
||||
//writer.WriteAttributeString( XmlConstants.MsdataPrefix,
|
||||
// XmlConstants.Ordinal,
|
||||
// XmlConstants.MsdataNamespace,
|
||||
// col.Ordinal.ToString() );
|
||||
|
||||
// Write SimpleType if column have MaxLength
|
||||
if (col.MaxLength > -1) {
|
||||
|
||||
WriteTableSimpleType (writer, col);
|
||||
}
|
||||
|
||||
|
||||
//</xs:element>
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
@@ -747,6 +850,31 @@ namespace System.Data {
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
|
||||
private void WriteTableSimpleType (XmlWriter writer, DataColumn col)
|
||||
{
|
||||
// SimpleType
|
||||
writer.WriteStartElement( XmlConstants.SchemaPrefix, XmlConstants.SimpleType,
|
||||
XmlConstants.SchemaNamespace);
|
||||
|
||||
// Restriction
|
||||
writer.WriteStartElement( XmlConstants.SchemaPrefix, XmlConstants.Restriction,
|
||||
XmlConstants.SchemaNamespace);
|
||||
|
||||
writer.WriteAttributeString( XmlConstants.Base, MapType( col.DataType ) );
|
||||
|
||||
// MaxValue
|
||||
writer.WriteStartElement( XmlConstants.SchemaPrefix, XmlConstants.MaxLength,
|
||||
XmlConstants.SchemaNamespace);
|
||||
writer.WriteAttributeString( XmlConstants.Value, col.MaxLength.ToString ());
|
||||
|
||||
|
||||
writer.WriteEndElement();
|
||||
|
||||
writer.WriteEndElement();
|
||||
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// Helper function to split columns into attributes elements and simple
|
||||
/// content
|
||||
@@ -787,10 +915,14 @@ namespace System.Data {
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private string MapType( Type type )
|
||||
{
|
||||
//TODO -
|
||||
return "xs:string";
|
||||
string Result;
|
||||
|
||||
Result = "xs:string";
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
#endregion //Private Xml Serialisation
|
||||
|
||||
@@ -430,8 +430,9 @@ namespace System.Data {
|
||||
[MonoTODO]
|
||||
public virtual DataTable Clone()
|
||||
{
|
||||
//FIXME:
|
||||
return this; //Don't know if this is correct
|
||||
DataTable Copy = new DataTable ();
|
||||
CopyProperties (Copy);
|
||||
return Copy;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -441,7 +442,7 @@ namespace System.Data {
|
||||
|
||||
[MonoTODO]
|
||||
public object Compute(string expression, string filter)
|
||||
{
|
||||
{
|
||||
//FIXME: //Do a real compute
|
||||
object obj = "a";
|
||||
return obj;
|
||||
@@ -453,10 +454,49 @@ namespace System.Data {
|
||||
[MonoTODO]
|
||||
public DataTable Copy()
|
||||
{
|
||||
//FIXME: Do a real copy
|
||||
return this;
|
||||
DataTable Copy = new DataTable ();
|
||||
|
||||
|
||||
CopyProperties (Copy);
|
||||
|
||||
foreach (DataRow Row in Rows) {
|
||||
DataRow NewRow = Copy.NewRow ();
|
||||
NewRow.RowError = Row.RowError;
|
||||
foreach (DataColumn C in Copy.Columns) {
|
||||
NewRow [C.ColumnName] = Row [C.ColumnName];
|
||||
}
|
||||
Copy.Rows.Add (NewRow);
|
||||
}
|
||||
|
||||
return Copy;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private void CopyProperties (DataTable Copy)
|
||||
{
|
||||
Copy.CaseSensitive = CaseSensitive;
|
||||
// Copy.ChildRelations
|
||||
// Copy.Constraints
|
||||
// Copy.Container
|
||||
// Copy.DefaultView
|
||||
// Copy.DesignMode
|
||||
Copy.DisplayExpression = DisplayExpression;
|
||||
// Copy.ExtendedProperties
|
||||
Copy.Locale = Locale;
|
||||
Copy.MinimumCapacity = MinimumCapacity;
|
||||
Copy.Namespace = Namespace;
|
||||
// Copy.ParentRelations
|
||||
Copy.Prefix = Prefix;
|
||||
//Copy.PrimaryKey = PrimaryKey;
|
||||
Copy.Site = Site;
|
||||
Copy.TableName = TableName;
|
||||
|
||||
// Copy columns
|
||||
foreach (DataColumn Column in Columns) {
|
||||
Copy.Columns.Add (CopyColumn (Column));
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Ends the initialization of a DataTable that is used
|
||||
/// on a form or used by another component. The
|
||||
@@ -784,6 +824,34 @@ namespace System.Data {
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private DataColumn CopyColumn (DataColumn Column)
|
||||
{
|
||||
DataColumn Copy = new DataColumn ();
|
||||
|
||||
// Copy all the properties of column
|
||||
Copy.AllowDBNull = Column.AllowDBNull;
|
||||
Copy.AutoIncrement = Column.AutoIncrement;
|
||||
Copy.AutoIncrementSeed = Column.AutoIncrementSeed;
|
||||
Copy.AutoIncrementStep = Column.AutoIncrementStep;
|
||||
Copy.Caption = Column.Caption;
|
||||
Copy.ColumnMapping = Column.ColumnMapping;
|
||||
Copy.ColumnName = Column.ColumnName;
|
||||
// Copy.Container
|
||||
// Copy.DataType
|
||||
// Copy.DefaultValue
|
||||
Copy.Expression = Column.Expression;
|
||||
//Copy.ExtendedProperties
|
||||
Copy.MaxLength = Column.MaxLength;
|
||||
Copy.Namespace = Column.Namespace;
|
||||
Copy.Prefix = Column.Prefix;
|
||||
Copy.ReadOnly = Column.ReadOnly;
|
||||
//Copy.Site
|
||||
Copy.Unique = Column.Unique;
|
||||
|
||||
return Copy;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when after a value has been changed for
|
||||
/// the specified DataColumn in a DataRow.
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Data {
|
||||
/// <summary>
|
||||
@@ -23,7 +24,6 @@ namespace System.Data {
|
||||
public class DataTableCollection : InternalDataCollectionBase
|
||||
{
|
||||
DataSet dataSet;
|
||||
const string defaultTableName = "Table1";
|
||||
|
||||
#region Constructors
|
||||
|
||||
@@ -62,13 +62,19 @@ namespace System.Data {
|
||||
|
||||
public virtual DataTable Add ()
|
||||
{
|
||||
return this.Add (defaultTableName);
|
||||
DataTable Table = new DataTable ();
|
||||
Add (Table);
|
||||
return Table;
|
||||
}
|
||||
|
||||
public virtual void Add (DataTable table)
|
||||
{
|
||||
if (table.TableName == null || table.TableName == string.Empty)
|
||||
NameTable (table);
|
||||
|
||||
list.Add (table);
|
||||
table.dataSet = dataSet;
|
||||
OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, table));
|
||||
}
|
||||
|
||||
public virtual DataTable Add (string name)
|
||||
@@ -118,6 +124,7 @@ namespace System.Data {
|
||||
public void Remove (DataTable table)
|
||||
{
|
||||
this.Remove (table.TableName);
|
||||
OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, table));
|
||||
}
|
||||
|
||||
public void Remove (string name)
|
||||
@@ -132,6 +139,39 @@ namespace System.Data {
|
||||
|
||||
#endregion
|
||||
|
||||
#region Protected methods
|
||||
|
||||
protected internal virtual void OnCollectionChanging (CollectionChangeEventArgs Args)
|
||||
{
|
||||
if (CollectionChanging != null)
|
||||
CollectionChanging (this, Args);
|
||||
}
|
||||
|
||||
protected virtual void OnCollectionChanged (CollectionChangeEventArgs Args)
|
||||
{
|
||||
if (CollectionChanged != null)
|
||||
CollectionChanged (this, Args);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private methods
|
||||
|
||||
/// <summary>
|
||||
/// gives name to Table (Table1, Table2, Table3,...)
|
||||
/// </summary>
|
||||
private void NameTable (DataTable Table)
|
||||
{
|
||||
string Name = "Table";
|
||||
int i = 1;
|
||||
while (Contains (Name + i))
|
||||
i++;
|
||||
|
||||
Table.TableName = Name + i;
|
||||
}
|
||||
|
||||
#endregion // Private methods
|
||||
|
||||
#region Events
|
||||
|
||||
[ResDescriptionAttribute ("Occurs whenever this collection's membership changes.")]
|
||||
|
||||
@@ -33,6 +33,9 @@ internal class XmlConstants
|
||||
public const string Element = "element";
|
||||
public const string Choice = "choice";
|
||||
public const string ComplexType = "complexType";
|
||||
public const string SimpleType = "simpleType";
|
||||
public const string Restriction = "restriction";
|
||||
public const string MaxLength = "maxLength";
|
||||
public const string Sequence = "sequence";
|
||||
public const string MaxOccurs = "maxOccurs";
|
||||
public const string MinOccurs = "minOccurs";
|
||||
@@ -43,7 +46,11 @@ internal class XmlConstants
|
||||
public const string TargetNamespace = "targetNamespace";
|
||||
public const string Form = "form";
|
||||
public const string Attribute = "attribute";
|
||||
|
||||
public const string Default = "default";
|
||||
public const string Caption = "Caption";
|
||||
public const string Base = "base";
|
||||
public const string Value = "value";
|
||||
|
||||
//ms schema objects
|
||||
public const string MsdataPrefix = "msdata";
|
||||
public const string MsdataNamespace = "urn:schemas-microsoft-com:xml-msdata";
|
||||
|
||||
@@ -35,48 +35,12 @@ namespace System.Data {
|
||||
DSet = set;
|
||||
}
|
||||
|
||||
public XmlReadMode LoadData (XmlReader r)
|
||||
{
|
||||
// FIXME: somekinda exception?
|
||||
if (!r.Read ())
|
||||
return XmlReadMode.Auto; // FIXME
|
||||
|
||||
/*\
|
||||
* If document is diffgram we will use diffgram
|
||||
\*/
|
||||
if (r.LocalName == "diffgram")
|
||||
return LoadData (r, XmlReadMode.DiffGram);
|
||||
|
||||
/*\
|
||||
* If we already have a schema, or the document
|
||||
* contains an in-line schema, sets XmlReadMode to ReadSchema.
|
||||
\*/
|
||||
|
||||
// FIXME: is this always true: "if we have tables we have to have schema also"
|
||||
if (DSet.Tables.Count > 0)
|
||||
return LoadData (r, XmlReadMode.ReadSchema);
|
||||
|
||||
/*\
|
||||
* If we dont have a schema yet and document
|
||||
* contains no inline-schema mode is XmlReadMode.InferSchema
|
||||
\*/
|
||||
|
||||
return LoadData (r, XmlReadMode.InferSchema);
|
||||
}
|
||||
|
||||
public XmlReadMode LoadData (XmlReader reader, XmlReadMode mode)
|
||||
{
|
||||
XmlReadMode Result = XmlReadMode.Auto;
|
||||
|
||||
switch (mode) {
|
||||
|
||||
case XmlReadMode.DiffGram:
|
||||
Result = XmlReadMode.DiffGram;
|
||||
ReadModeDiffGram (reader);
|
||||
break;
|
||||
case XmlReadMode.Auto:
|
||||
LoadData (reader);
|
||||
break;
|
||||
case XmlReadMode.Fragment:
|
||||
break;
|
||||
case XmlReadMode.ReadSchema:
|
||||
@@ -98,18 +62,6 @@ namespace System.Data {
|
||||
return Result;
|
||||
}
|
||||
|
||||
// These methods should be in their own class for example XmlDiffLoader. But for now, let them be here
|
||||
#region diffgram-methods
|
||||
|
||||
// XmlReadMode.DiffGram
|
||||
private void ReadModeDiffGram (XmlReader reader)
|
||||
{
|
||||
XmlDiffLoader DiffLoader = new XmlDiffLoader (DSet);
|
||||
DiffLoader.Load (reader);
|
||||
}
|
||||
|
||||
#endregion // diffgram-methods
|
||||
|
||||
#region reading
|
||||
|
||||
// XmlReadMode.InferSchema
|
||||
@@ -134,15 +86,16 @@ namespace System.Data {
|
||||
if (reader.NodeType == XmlNodeType.Element) {
|
||||
|
||||
string datatablename = reader.LocalName;
|
||||
bool addTable = true;
|
||||
DataTable table;
|
||||
bool NewTable = false;
|
||||
|
||||
if (!DSet.Tables.Contains (datatablename)) {
|
||||
table = new DataTable (reader.LocalName);
|
||||
DSet.Tables.Add (table);
|
||||
NewTable = true;
|
||||
}
|
||||
else {
|
||||
table = DSet.Tables [datatablename];
|
||||
addTable = false;
|
||||
}
|
||||
|
||||
Hashtable rowValue = new Hashtable ();
|
||||
@@ -153,7 +106,7 @@ namespace System.Data {
|
||||
if (reader.NodeType == XmlNodeType.Element) {
|
||||
|
||||
string dataColumnName = reader.LocalName;
|
||||
if (addTable)
|
||||
if (NewTable)
|
||||
table.Columns.Add (dataColumnName);
|
||||
|
||||
// FIXME: exception?
|
||||
@@ -172,9 +125,6 @@ namespace System.Data {
|
||||
}
|
||||
|
||||
table.Rows.Add (row);
|
||||
|
||||
if (addTable)
|
||||
DSet.Tables.Add (table);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
//
|
||||
// (C) 2002 Ville Palo
|
||||
//
|
||||
// TODO: Relations
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
@@ -22,10 +24,6 @@ using System.Globalization;
|
||||
|
||||
namespace System.Data {
|
||||
|
||||
/*\
|
||||
* There is so much TODO here that i dont bother to list them.
|
||||
\*/
|
||||
|
||||
internal class XmlSchemaMapper
|
||||
{
|
||||
#region Fields
|
||||
@@ -53,9 +51,8 @@ namespace System.Data {
|
||||
XmlSchema Schema = XmlSchema.Read (Reader, new ValidationEventHandler (OnXmlSchemaValidation));
|
||||
|
||||
// read items
|
||||
foreach (XmlSchemaObject Item in Schema.Items) {
|
||||
foreach (XmlSchemaObject Item in Schema.Items)
|
||||
ReadXmlSchemaItem (Item);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Public methods
|
||||
@@ -89,8 +86,6 @@ namespace System.Data {
|
||||
|
||||
private void ReadXmlSchemaChoice (XmlSchemaChoice Choice)
|
||||
{
|
||||
//MaxOccurs
|
||||
|
||||
XmlSchemaObject SchemaObject;
|
||||
foreach (XmlSchemaObject TempObject in Choice.Items) {
|
||||
|
||||
@@ -129,9 +124,11 @@ namespace System.Data {
|
||||
DataTable TempTable = new DataTable (Element.Name);
|
||||
DSet.Tables.Add (TempTable);
|
||||
|
||||
// FIXME: if this element comes before types
|
||||
// If type is already defined in schema read it...
|
||||
if (TypeCollection.Contains (Element.SchemaTypeName.ToString ()))
|
||||
ReadXmlSchemaType ((XmlSchemaType)TypeCollection [Element.SchemaTypeName.ToString ()], TempTable);
|
||||
else // but if it's not yet defined put it safe to wait if we need it later.
|
||||
ElementCollection.Add (Element.SchemaTypeName.Name, TempTable);
|
||||
|
||||
}
|
||||
else if (Element.RefName != null && Element.RefName.Name != string.Empty) { // if there is a ref=
|
||||
@@ -172,13 +169,12 @@ namespace System.Data {
|
||||
DataColumn Column = new DataColumn (Element.Name);
|
||||
Table.Columns.Add (Column);
|
||||
|
||||
if (Element.UnhandledAttributes == null)
|
||||
return;
|
||||
|
||||
foreach (XmlAttribute Attr in Element.UnhandledAttributes) {
|
||||
|
||||
switch (Attr.LocalName) {
|
||||
if (Element.UnhandledAttributes != null) {
|
||||
|
||||
foreach (XmlAttribute Attr in Element.UnhandledAttributes) {
|
||||
|
||||
switch (Attr.LocalName) {
|
||||
|
||||
case "Caption":
|
||||
Column.Caption = Attr.Value;
|
||||
break;
|
||||
@@ -187,10 +183,10 @@ namespace System.Data {
|
||||
break;
|
||||
case "type":
|
||||
// FIXME:
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +194,6 @@ namespace System.Data {
|
||||
// Handel rest of the parameters
|
||||
//
|
||||
|
||||
// FIXME: Default columntype is string???
|
||||
if (Column.DataType == null)
|
||||
Column.DataType = Type.GetType ("System.String");
|
||||
|
||||
@@ -360,8 +355,23 @@ namespace System.Data {
|
||||
{
|
||||
XmlSchemaComplexType ComplexType = Type as XmlSchemaComplexType;
|
||||
|
||||
if (ComplexType.Name != null && !TypeCollection.Contains (ComplexType.Name)) {
|
||||
TypeCollection.Add (ComplexType.Name, ComplexType);
|
||||
if (ComplexType.Name != null && ComplexType.Name != string.Empty) {
|
||||
if (ElementCollection.Contains (ComplexType.Name)) {
|
||||
|
||||
XmlSchemaParticle Particle;
|
||||
if ((Particle = ComplexType.Particle as XmlSchemaChoice) != null) {
|
||||
ReadXmlSchemaChoice (Particle as XmlSchemaChoice);
|
||||
}
|
||||
else if ((Particle = ComplexType.Particle as XmlSchemaSequence) != null) {
|
||||
DataTable TempTable = ElementCollection [ComplexType.Name] as DataTable;
|
||||
ElementCollection.Remove (ComplexType.Name);
|
||||
ReadXmlSchemaSequence (Particle as XmlSchemaSequence, TempTable);
|
||||
}
|
||||
|
||||
}
|
||||
else if (ComplexType.Name != null && !TypeCollection.Contains (ComplexType.Name)) {
|
||||
TypeCollection.Add (ComplexType.Name, ComplexType);
|
||||
}
|
||||
}
|
||||
else {
|
||||
XmlSchemaParticle Particle;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
// Ville Palo <[email protected]>
|
||||
//
|
||||
// (c)copyright 2002 Daniel Morgan
|
||||
// (c)copyright 2003 Ville Palo
|
||||
//
|
||||
// XmlDataDocument is included within the Mono Class Library.
|
||||
//
|
||||
@@ -24,6 +25,7 @@ using System.Text;
|
||||
using System.Xml.XPath;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace System.Xml {
|
||||
|
||||
@@ -47,21 +49,86 @@ namespace System.Xml {
|
||||
public XmlDataDocument() {
|
||||
|
||||
dataSet = new DataSet();
|
||||
dataSet.Tables.CollectionChanged += new CollectionChangeEventHandler (OnDataTableChanged);
|
||||
|
||||
this.NodeChanged += new XmlNodeChangedEventHandler (OnNodeChanged);
|
||||
//this.NodeChanging += new XmlNodeChangedEventHandler (OnXmlDataColumnChanged);
|
||||
this.NodeChanging += new XmlNodeChangedEventHandler (OnNodeChanging);
|
||||
this.NodeInserting += new XmlNodeChangedEventHandler (OnNodeInserting);
|
||||
this.NodeRemoved += new XmlNodeChangedEventHandler (OnNodeRemoved);
|
||||
this.NodeInserted += new XmlNodeChangedEventHandler (OnNodeInserted);
|
||||
DataSet.EnforceConstraints = false;
|
||||
}
|
||||
|
||||
public XmlDataDocument(DataSet dataset) {
|
||||
|
||||
this.dataSet = dataset;
|
||||
|
||||
// Read DataSet in as document if there is data in tables
|
||||
bool HaveRows = false;
|
||||
foreach (DataTable T in dataSet.Tables) {
|
||||
|
||||
if (T.Rows.Count > 0) {
|
||||
HaveRows = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (HaveRows) {
|
||||
|
||||
XmlReader xmlReader = new XmlTextReader (new StringReader (dataSet.GetXml ()));
|
||||
|
||||
// Load DataSet's xml-data
|
||||
base.Load (xmlReader);
|
||||
xmlReader.Close ();
|
||||
}
|
||||
|
||||
foreach (DataTable Table in DataSet.Tables) {
|
||||
|
||||
foreach (DataRow Row in Table.Rows) {
|
||||
Row.XmlRowID = dataRowID;
|
||||
dataRowIDList.Add (dataRowID);
|
||||
dataRowID++;
|
||||
}
|
||||
}
|
||||
|
||||
this.NodeChanged += new XmlNodeChangedEventHandler (OnNodeChanged);
|
||||
//this.NodeChanging += new XmlNodeChangedEventHandler (OnXmlDataColumnChanged);
|
||||
this.NodeChanging += new XmlNodeChangedEventHandler (OnNodeChanging);
|
||||
this.NodeInserting += new XmlNodeChangedEventHandler (OnNodeInserting);
|
||||
this.NodeRemoved += new XmlNodeChangedEventHandler (OnNodeRemoved);
|
||||
this.NodeInserted += new XmlNodeChangedEventHandler (OnNodeInserted);
|
||||
|
||||
foreach (DataTable Table in dataSet.Tables) {
|
||||
Table.ColumnChanged += new DataColumnChangeEventHandler (OnDataTableColumnChanged);
|
||||
Table.RowDeleted += new DataRowChangeEventHandler (OnDataTableRowDeleted);
|
||||
Table.RowChanged += new DataRowChangeEventHandler (OnDataTableRowChanged);
|
||||
}
|
||||
}
|
||||
|
||||
// bool clone. If we are cloning XmlDataDocument then clone should be true.
|
||||
private XmlDataDocument (DataSet dataset, bool clone)
|
||||
{
|
||||
this.dataSet = dataset;
|
||||
|
||||
foreach (DataTable Table in DataSet.Tables) {
|
||||
|
||||
foreach (DataRow Row in Table.Rows) {
|
||||
Row.XmlRowID = dataRowID;
|
||||
dataRowIDList.Add (dataRowID);
|
||||
dataRowID++;
|
||||
}
|
||||
}
|
||||
|
||||
this.NodeChanged += new XmlNodeChangedEventHandler (OnNodeChanged);
|
||||
this.NodeChanging += new XmlNodeChangedEventHandler (OnNodeChanging);
|
||||
this.NodeInserting += new XmlNodeChangedEventHandler (OnNodeInserting);
|
||||
this.NodeRemoved += new XmlNodeChangedEventHandler (OnNodeRemoved);
|
||||
this.NodeInserted += new XmlNodeChangedEventHandler (OnNodeInserted);
|
||||
|
||||
foreach (DataTable Table in dataSet.Tables) {
|
||||
Table.ColumnChanged += new DataColumnChangeEventHandler (OnDataTableColumnChanged);
|
||||
Table.RowDeleted += new DataRowChangeEventHandler (OnDataTableRowDeleted);
|
||||
Table.RowChanged += new DataRowChangeEventHandler (OnDataTableRowChanged);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
@@ -77,7 +144,6 @@ namespace System.Xml {
|
||||
}
|
||||
|
||||
public DataSet DataSet {
|
||||
[MonoTODO]
|
||||
get {
|
||||
return dataSet;
|
||||
}
|
||||
@@ -85,19 +151,19 @@ namespace System.Xml {
|
||||
|
||||
// override inheritted method from XmlDocument
|
||||
public override string InnerXml {
|
||||
[MonoTODO]
|
||||
[MonoTODO("override???")]
|
||||
get {
|
||||
throw new NotImplementedException();
|
||||
return base.InnerXml;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
set {
|
||||
throw new NotImplementedException();
|
||||
base.InnerXml = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsReadOnly {
|
||||
[MonoTODO]
|
||||
[MonoTODO("override???")]
|
||||
get {
|
||||
return isReadOnly;
|
||||
}
|
||||
@@ -106,36 +172,35 @@ namespace System.Xml {
|
||||
|
||||
// Item indexer
|
||||
public override XmlElement this[string name] {
|
||||
[MonoTODO]
|
||||
[MonoTODO("override???")]
|
||||
get {
|
||||
throw new NotImplementedException();
|
||||
return base [name];
|
||||
}
|
||||
}
|
||||
|
||||
// Item indexer
|
||||
public override XmlElement this[string localname, string ns] {
|
||||
[MonoTODO]
|
||||
[MonoTODO("override???")]
|
||||
get {
|
||||
throw new NotImplementedException();
|
||||
return base [localname, ns];
|
||||
}
|
||||
}
|
||||
|
||||
public override string LocalName {
|
||||
[MonoTODO]
|
||||
[MonoTODO("override???")]
|
||||
get {
|
||||
throw new NotImplementedException();
|
||||
return base.LocalName;
|
||||
}
|
||||
}
|
||||
|
||||
public override string Name {
|
||||
[MonoTODO]
|
||||
[MonoTODO("override??")]
|
||||
get {
|
||||
return base.Name;
|
||||
}
|
||||
}
|
||||
|
||||
public override XmlDocument OwnerDocument {
|
||||
[MonoTODO]
|
||||
get {
|
||||
return null;
|
||||
}
|
||||
@@ -148,7 +213,23 @@ namespace System.Xml {
|
||||
[MonoTODO]
|
||||
public override XmlNode CloneNode(bool deep)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
XmlDataDocument Document;
|
||||
if (deep)
|
||||
Document = new XmlDataDocument (DataSet.Copy (), true);
|
||||
else
|
||||
Document = new XmlDataDocument (DataSet.Clone (), true);
|
||||
|
||||
RemoveXmlDocumentListeners ();
|
||||
|
||||
Document.PreserveWhitespace = PreserveWhitespace;
|
||||
if (deep) {
|
||||
foreach(XmlNode n in ChildNodes)
|
||||
Document.AppendChild (Document.ImportNode (n, deep));
|
||||
}
|
||||
|
||||
AddXmlDocumentListeners ();
|
||||
|
||||
return Document;
|
||||
}
|
||||
|
||||
#region overloaded CreateElement methods
|
||||
@@ -204,10 +285,8 @@ namespace System.Xml {
|
||||
if (c == 0)
|
||||
return null;
|
||||
|
||||
// FIXME: I dont know which way it should be but this work on linux.
|
||||
// could be also GetElementsByTagName (args.OldParent.Name) []
|
||||
XmlNodeList nodeList = GetElementsByTagName (node.Name);
|
||||
|
||||
|
||||
int i = 0;
|
||||
bool isSame = false;
|
||||
|
||||
@@ -243,7 +322,6 @@ namespace System.Xml {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
@@ -263,46 +341,38 @@ namespace System.Xml {
|
||||
|
||||
public override void Load(XmlReader reader) {
|
||||
|
||||
// dont listen these events
|
||||
RemoveXmlDocumentListeners ();
|
||||
bool OldEC = DataSet.EnforceConstraints;
|
||||
DataSet.EnforceConstraints = false;
|
||||
|
||||
DataTable dt = null;
|
||||
dataSet.Tables.CollectionChanged -= new CollectionChangeEventHandler (OnDataTableChanged);
|
||||
|
||||
// For reading xml to XmlDocument
|
||||
XmlTextReader textReader = new XmlTextReader (
|
||||
reader.BaseURI);
|
||||
|
||||
// dont listen these events
|
||||
RemoveXmlDocumentListeners ();
|
||||
DataTable dt = null;
|
||||
|
||||
|
||||
if (reader.NodeType != XmlNodeType.Element)
|
||||
reader.MoveToContent ();
|
||||
|
||||
// TODO: Findout which exception should be throwen
|
||||
if (reader.NodeType != XmlNodeType.Element) {
|
||||
throw new Exception ();
|
||||
}
|
||||
|
||||
if (dataSet.DataSetName != reader.Name) {
|
||||
throw new Exception ();
|
||||
}
|
||||
|
||||
// read to next element
|
||||
while (reader.Read () && reader.NodeType != XmlNodeType.Element);
|
||||
|
||||
do {
|
||||
|
||||
// Find right table from tablecollection
|
||||
for (int i = 0; i < DataSet.Tables.Count && dt == null; i++) {
|
||||
if (DataSet.Tables.Contains (reader.LocalName)) {
|
||||
|
||||
if (reader.Name == DataSet.Tables [i].TableName) {
|
||||
|
||||
dt = DataSet.Tables [i];
|
||||
dt.ColumnChanged += new DataColumnChangeEventHandler (OnDataTableColumnChanged);
|
||||
dt.RowDeleted += new DataRowChangeEventHandler (OnDataTableRowDeleted);
|
||||
dt.RowChanged += new DataRowChangeEventHandler (OnDataTableRowChanged);
|
||||
}
|
||||
dt = DataSet.Tables [reader.LocalName];
|
||||
dt.ColumnChanged += new DataColumnChangeEventHandler (OnDataTableColumnChanged);
|
||||
dt.RowDeleted += new DataRowChangeEventHandler (OnDataTableRowDeleted);
|
||||
dt.RowChanged += new DataRowChangeEventHandler (OnDataTableRowChanged);
|
||||
}
|
||||
|
||||
// TODO: Findout what kind of exception
|
||||
if (dt == null)
|
||||
throw new Exception (); // there were no correct table
|
||||
else
|
||||
continue;
|
||||
|
||||
// Read rows to table
|
||||
DataRow tempRow = dt.NewRow ();
|
||||
@@ -330,8 +400,11 @@ namespace System.Xml {
|
||||
} while (reader.Read ());
|
||||
|
||||
base.Load (textReader);
|
||||
textReader.Close ();
|
||||
|
||||
DataSet.EnforceConstraints = OldEC;
|
||||
AddXmlDocumentListeners ();
|
||||
dataSet.Tables.CollectionChanged += new CollectionChangeEventHandler (OnDataTableChanged);
|
||||
}
|
||||
|
||||
#endregion // overloaded Load methods
|
||||
@@ -350,35 +423,46 @@ namespace System.Xml {
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
//FIXME: how do you handle this?
|
||||
//FIXME: when internal protected bug is fixed uncomment this
|
||||
//[MonoTODO]
|
||||
//protected internal override XPathNavigator CreateNavigator(XmlNode node) {
|
||||
// throw new NotImplementedException();
|
||||
//}
|
||||
|
||||
[MonoTODO]
|
||||
public new XPathNavigator CreateNavigator() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion // Protected Methods
|
||||
|
||||
#region DataSet event handlers
|
||||
|
||||
#region XmlDocument event handlers
|
||||
|
||||
private void OnNodeChanging (object sender, XmlNodeChangedEventArgs args)
|
||||
{
|
||||
if (DataSet.EnforceConstraints)
|
||||
throw new InvalidOperationException (Locale.GetText ("Please set DataSet.EnforceConstraints == false " +
|
||||
"before trying to edit XmlDataDocument using " +
|
||||
"XML operations."));
|
||||
}
|
||||
|
||||
// Invoked when XmlNode is changed colum is changed
|
||||
[MonoTODO]
|
||||
private void OnNodeChanged (object sender, XmlNodeChangedEventArgs args)
|
||||
{
|
||||
|
||||
if (args.Node == null)
|
||||
return;
|
||||
|
||||
DataRow row = GetRowFromElement ((XmlElement)args.Node);
|
||||
|
||||
DataRow row = GetRowFromElement ((XmlElement)args.Node.ParentNode.ParentNode);
|
||||
|
||||
if (row == null)
|
||||
return;
|
||||
|
||||
if (row [args.Node.Name].ToString () != args.Node.InnerText)
|
||||
row [args.Node.Name] = args.Node.InnerText;
|
||||
|
||||
if (!row.Table.Columns.Contains (args.Node.ParentNode.Name))
|
||||
return;
|
||||
|
||||
row.Table.ColumnChanged -= new DataColumnChangeEventHandler (OnDataTableColumnChanged);
|
||||
|
||||
if (row [args.Node.ParentNode.Name].ToString () != args.Node.InnerText)
|
||||
row [args.Node.ParentNode.Name] = args.Node.InnerText;
|
||||
|
||||
row.Table.ColumnChanged += new DataColumnChangeEventHandler (OnDataTableColumnChanged);
|
||||
}
|
||||
|
||||
// Invoked when XmlNode is removed
|
||||
@@ -388,37 +472,24 @@ namespace System.Xml {
|
||||
if (args.OldParent == null)
|
||||
return;
|
||||
|
||||
if (!(args.OldParent is XmlElement))
|
||||
return;
|
||||
|
||||
DataRow row = GetRowFromElement ((XmlElement)args.OldParent);
|
||||
|
||||
if (row == null) {
|
||||
if (row == null)
|
||||
return ;
|
||||
}
|
||||
|
||||
// Dont trig event again
|
||||
row.Table.ColumnChanged -= new DataColumnChangeEventHandler (OnDataTableColumnChanged);
|
||||
|
||||
row [args.Node.Name] = null;
|
||||
|
||||
// if all columns are "nulled" we can remove the row.
|
||||
// FIXME: This is rather slow, try to find faster way
|
||||
bool allNulls = true;
|
||||
foreach (DataColumn dc in row.Table.Columns) {
|
||||
|
||||
if (row [dc.ColumnName] != DBNull.Value) {
|
||||
allNulls = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (allNulls) {
|
||||
dataRowIDList.Remove (row.XmlRowID);
|
||||
row.Delete ();
|
||||
}
|
||||
|
||||
row.Table.ColumnChanged += new DataColumnChangeEventHandler (OnDataTableColumnChanged);
|
||||
}
|
||||
|
||||
private void OnNodeInserting (object sender, XmlNodeChangedEventArgs args) {
|
||||
|
||||
private void OnNodeInserting (object sender, XmlNodeChangedEventArgs args)
|
||||
{
|
||||
if (DataSet.EnforceConstraints)
|
||||
throw new InvalidOperationException (Locale.GetText ("Please set DataSet.EnforceConstraints == false " +
|
||||
"before trying to edit XmlDataDocument using " +
|
||||
@@ -429,7 +500,7 @@ namespace System.Xml {
|
||||
private void OnNodeInserted (object sender, XmlNodeChangedEventArgs args)
|
||||
{
|
||||
|
||||
// this is table element
|
||||
// this is table element
|
||||
if (DataSet.Tables.Contains (args.NewParent.Name)) {
|
||||
|
||||
Hashtable ht = null;
|
||||
@@ -453,12 +524,13 @@ namespace System.Xml {
|
||||
|
||||
DataTable dt = DataSet.Tables [args.Node.Name];
|
||||
DataRow row = dt.NewRow ();
|
||||
|
||||
Hashtable ht = TempTable [args.Node.Name] as Hashtable;
|
||||
|
||||
Hashtable ht = TempTable [args.Node.Name] as Hashtable;
|
||||
|
||||
IDictionaryEnumerator enumerator = ht.GetEnumerator ();
|
||||
while (enumerator.MoveNext ()) {
|
||||
row [enumerator.Key.ToString ()] = enumerator.Value.ToString ();
|
||||
if (dt.Columns.Contains (enumerator.Key.ToString ()))
|
||||
row [enumerator.Key.ToString ()] = enumerator.Value.ToString ();
|
||||
}
|
||||
|
||||
dt.RowChanged -= new DataRowChangeEventHandler (OnDataTableRowChanged);
|
||||
@@ -467,7 +539,23 @@ namespace System.Xml {
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
#endregion // DataSet event handlers
|
||||
|
||||
#region DataSet event handlers
|
||||
|
||||
// If DataTable is added or removed from DataSet
|
||||
private void OnDataTableChanged (object sender, CollectionChangeEventArgs eventArgs)
|
||||
{
|
||||
DataTable Table = (DataTable)eventArgs.Element;
|
||||
if (eventArgs.Action == CollectionChangeAction.Add) {
|
||||
Table.ColumnChanged += new DataColumnChangeEventHandler (OnDataTableColumnChanged);
|
||||
Table.RowDeleted += new DataRowChangeEventHandler (OnDataTableRowDeleted);
|
||||
Table.RowChanged += new DataRowChangeEventHandler (OnDataTableRowChanged);
|
||||
}
|
||||
}
|
||||
|
||||
// If column has changed
|
||||
[MonoTODO]
|
||||
private void OnDataTableColumnChanged(object sender,
|
||||
DataColumnChangeEventArgs eventArgs)
|
||||
{
|
||||
@@ -543,10 +631,15 @@ namespace System.Xml {
|
||||
// Create row element. Row's name same as TableName
|
||||
DataRow row = args.Row;
|
||||
row.XmlRowID = dataRowID;
|
||||
dataRowIDList.Add (dataRowID);
|
||||
dataRowID++;
|
||||
|
||||
if (DocumentElement == null)
|
||||
this.AppendChild (CreateElement (DataSet.DataSetName));
|
||||
|
||||
XmlElement element = CreateElement (args.Row.Table.TableName);
|
||||
DocumentElement.AppendChild (element);
|
||||
|
||||
|
||||
XmlElement rowElement = null;
|
||||
|
||||
for (int i = 0; i < row.Table.Columns.Count; i++) {
|
||||
@@ -554,7 +647,6 @@ namespace System.Xml {
|
||||
rowElement = CreateElement (row.Table.Columns [i].ToString ());
|
||||
rowElement.InnerText = (string)row [i];
|
||||
element.AppendChild (rowElement);
|
||||
|
||||
}
|
||||
|
||||
AddXmlDocumentListeners ();
|
||||
@@ -617,12 +709,16 @@ namespace System.Xml {
|
||||
{
|
||||
this.NodeInserting -= new XmlNodeChangedEventHandler (OnNodeInserting);
|
||||
this.NodeInserted -= new XmlNodeChangedEventHandler (OnNodeInserted);
|
||||
this.NodeChanged -= new XmlNodeChangedEventHandler (OnNodeChanged);
|
||||
this.NodeChanging -= new XmlNodeChangedEventHandler (OnNodeChanging);
|
||||
}
|
||||
|
||||
private void AddXmlDocumentListeners ()
|
||||
{
|
||||
this.NodeInserting += new XmlNodeChangedEventHandler (OnNodeInserting);
|
||||
this.NodeInserted += new XmlNodeChangedEventHandler (OnNodeInserted);
|
||||
this.NodeChanged += new XmlNodeChangedEventHandler (OnNodeChanged);
|
||||
this.NodeChanging += new XmlNodeChangedEventHandler (OnNodeChanging);
|
||||
}
|
||||
#endregion // Private methods
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2003-01-13 Ville Palo <[email protected]>
|
||||
|
||||
* data_linux_test.args: Added some classes
|
||||
|
||||
2002-12-16 Ville Palo <[email protected]>
|
||||
|
||||
* System.Xml/XmlDataDocumentTest.cs: some fixes.
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace MonoTests.System.Data
|
||||
suite.AddTest (new TestSuite (typeof (DataRowTest)));
|
||||
suite.AddTest (new TestSuite (typeof (DataColumnCollectionTest)));
|
||||
suite.AddTest (new TestSuite (typeof (DataSetTest)));
|
||||
suite.AddTest (new TestSuite (typeof (DataRelationTest)));
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
2003-14-01 Ville Palo <[email protected]>
|
||||
|
||||
* DataRelationTest.cs: Added more tests
|
||||
|
||||
2003-13-01 Ville Palo <[email protected]>
|
||||
|
||||
* DataRelationTest.cs: Test class for DataRelation
|
||||
|
||||
2002-12-26 Ville Palo <[email protected]>
|
||||
|
||||
* own_schema.xsd: XmlSchema for testing ReadXmlSchema() -method
|
||||
|
||||
@@ -0,0 +1,378 @@
|
||||
//
|
||||
// DataRelationTest.cs - NUnit Test Cases for DataRelation
|
||||
//
|
||||
// Ville Palo ([email protected])
|
||||
//
|
||||
// (C) Ville Palo 2003
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
namespace MonoTests.System.Data
|
||||
{
|
||||
|
||||
public class DataRelationTest : TestCase
|
||||
{
|
||||
public DataRelationTest() : base ("MonoTests.System.Data.DataRelation") {}
|
||||
public DataRelationTest(string name) : base(name) {}
|
||||
|
||||
protected override void SetUp() {}
|
||||
|
||||
protected override void TearDown() {}
|
||||
|
||||
public static ITest Suite {
|
||||
get {
|
||||
return new TestSuite(typeof(DataRelationTest));
|
||||
}
|
||||
}
|
||||
|
||||
public void TestCreation ()
|
||||
{
|
||||
DataSet Set = new DataSet ();
|
||||
DataTable Mom = new DataTable ("Mom");
|
||||
DataTable Child = new DataTable ("Child");
|
||||
Set.Tables.Add (Mom);
|
||||
Set.Tables.Add (Child);
|
||||
|
||||
DataColumn Col = new DataColumn ("Name");
|
||||
DataColumn Col2 = new DataColumn ("ChildName");
|
||||
Mom.Columns.Add (Col);
|
||||
Mom.Columns.Add (Col2);
|
||||
|
||||
DataColumn Col3 = new DataColumn ("Name");
|
||||
DataColumn Col4 = new DataColumn ("Age");
|
||||
Child.Columns.Add (Col3);
|
||||
Child.Columns.Add (Col4);
|
||||
|
||||
DataRelation Relation = new DataRelation ("Rel", Col2, Col3);
|
||||
Set.Relations.Add (Relation);
|
||||
DataRelation Test = null;
|
||||
AssertEquals ("test#01", 1, Mom.ChildRelations.Count);
|
||||
AssertEquals ("test#02", 0, Child.ChildRelations.Count);
|
||||
AssertEquals ("test#03", 0, Mom.ParentRelations.Count);
|
||||
AssertEquals ("test#04", 1, Child.ParentRelations.Count);
|
||||
|
||||
Test = Child.ParentRelations [0];
|
||||
AssertEquals ("test#05", "Rel", Test.ToString ());
|
||||
AssertEquals ("test#06", "Rel", Test.RelationName);
|
||||
AssertEquals ("test#07", "Mom", Test.ParentTable.TableName);
|
||||
AssertEquals ("test#08", 1, Test.ParentKeyConstraint.Columns.Length);
|
||||
AssertEquals ("test#09", false, Test.ParentKeyConstraint.IsPrimaryKey);
|
||||
AssertEquals ("test#10", 1, Test.ParentColumns.Length);
|
||||
AssertEquals ("test#11", false, Test.Nested);
|
||||
AssertEquals ("test#12", 0, Test.ExtendedProperties.Count);
|
||||
AssertEquals ("test#13", "Child", Test.ChildTable.TableName);
|
||||
AssertEquals ("test#14", "Rel", Test.ChildKeyConstraint.ConstraintName);
|
||||
AssertEquals ("test#15", 1, Test.ChildColumns.Length);
|
||||
}
|
||||
|
||||
public void TestCreation2 ()
|
||||
{
|
||||
DataSet Set = new DataSet ();
|
||||
DataTable Mom = new DataTable ("Mom");
|
||||
DataTable Child = new DataTable ("Child");
|
||||
DataTable Hubby = new DataTable ("Hubby");
|
||||
Set.Tables.Add (Mom);
|
||||
Set.Tables.Add (Child);
|
||||
Set.Tables.Add (Hubby);
|
||||
|
||||
DataColumn Col = new DataColumn ("Name");
|
||||
DataColumn Col2 = new DataColumn ("ChildName");
|
||||
DataColumn Col3 = new DataColumn ("hubby");
|
||||
Mom.Columns.Add (Col);
|
||||
Mom.Columns.Add (Col2);
|
||||
Mom.Columns.Add (Col3);
|
||||
|
||||
DataColumn Col4 = new DataColumn ("Name");
|
||||
DataColumn Col5 = new DataColumn ("Age");
|
||||
DataColumn Col6 = new DataColumn ("father");
|
||||
Child.Columns.Add (Col4);
|
||||
Child.Columns.Add (Col5);
|
||||
Child.Columns.Add (Col6);
|
||||
|
||||
|
||||
DataColumn Col7 = new DataColumn ("Name");
|
||||
DataColumn Col8 = new DataColumn ("Age");
|
||||
Hubby.Columns.Add (Col7);
|
||||
Hubby.Columns.Add (Col8);
|
||||
|
||||
|
||||
DataColumn [] Parents = new DataColumn [2];
|
||||
Parents [0] = Col2;
|
||||
Parents [1] = Col3;
|
||||
DataColumn [] Childs = new DataColumn [2];
|
||||
Childs [0] = Col4;
|
||||
Childs [1] = Col7;
|
||||
|
||||
DataRelation Relation = null;
|
||||
try {
|
||||
Relation = new DataRelation ("Rel", Parents, Childs);
|
||||
Fail ("test#01");
|
||||
} catch (Exception e) {
|
||||
AssertEquals ("test#02", typeof (InvalidConstraintException), e.GetType ());
|
||||
AssertEquals ("test#03", "Cannot create a Key from Columns that belong to different tables.", e.Message);
|
||||
}
|
||||
|
||||
Childs [1] = Col6;
|
||||
Relation = new DataRelation ("Rel", Parents, Childs);
|
||||
|
||||
Set.Relations.Add (Relation);
|
||||
|
||||
DataRelation Test = null;
|
||||
AssertEquals ("test#01", 1, Mom.ChildRelations.Count);
|
||||
AssertEquals ("test#02", 0, Child.ChildRelations.Count);
|
||||
AssertEquals ("test#03", 0, Mom.ParentRelations.Count);
|
||||
AssertEquals ("test#04", 1, Child.ParentRelations.Count);
|
||||
|
||||
Test = Child.ParentRelations [0];
|
||||
AssertEquals ("test#05", "Rel", Test.ToString ());
|
||||
AssertEquals ("test#06", "Rel", Test.RelationName);
|
||||
AssertEquals ("test#07", "Mom", Test.ParentTable.TableName);
|
||||
AssertEquals ("test#08", 2, Test.ParentKeyConstraint.Columns.Length);
|
||||
AssertEquals ("test#09", false, Test.ParentKeyConstraint.IsPrimaryKey);
|
||||
AssertEquals ("test#10", 2, Test.ParentColumns.Length);
|
||||
AssertEquals ("test#11", false, Test.Nested);
|
||||
AssertEquals ("test#12", 0, Test.ExtendedProperties.Count);
|
||||
AssertEquals ("test#13", "Child", Test.ChildTable.TableName);
|
||||
AssertEquals ("test#14", "Rel", Test.ChildKeyConstraint.ConstraintName);
|
||||
AssertEquals ("test#15", 2, Test.ChildColumns.Length);
|
||||
AssertEquals ("test#16", 1, Mom.Constraints.Count);
|
||||
AssertEquals ("test#17", "Constraint1", Mom.Constraints [0].ToString ());
|
||||
AssertEquals ("test#18", 1, Child.Constraints.Count);
|
||||
AssertEquals ("test#19", 0, Hubby.Constraints.Count);
|
||||
}
|
||||
|
||||
public void TestCreation3 ()
|
||||
{
|
||||
DataSet Set = new DataSet ();
|
||||
DataTable Mom = new DataTable ("Mom");
|
||||
DataTable Child = new DataTable ("Child");
|
||||
Set.Tables.Add (Mom);
|
||||
Set.Tables.Add (Child);
|
||||
|
||||
DataColumn Col = new DataColumn ("Name");
|
||||
DataColumn Col2 = new DataColumn ("ChildName");
|
||||
Mom.Columns.Add (Col);
|
||||
Mom.Columns.Add (Col2);
|
||||
|
||||
DataColumn Col3 = new DataColumn ("Name");
|
||||
DataColumn Col4 = new DataColumn ("Age");
|
||||
Child.Columns.Add (Col3);
|
||||
Child.Columns.Add (Col4);
|
||||
|
||||
DataRelation Relation = new DataRelation ("Rel", Col2, Col3, false);
|
||||
Set.Relations.Add (Relation);
|
||||
DataRelation Test = null;
|
||||
|
||||
AssertEquals ("test#01", 1, Mom.ChildRelations.Count);
|
||||
AssertEquals ("test#02", 0, Child.ChildRelations.Count);
|
||||
AssertEquals ("test#03", 0, Mom.ParentRelations.Count);
|
||||
AssertEquals ("test#04", 1, Child.ParentRelations.Count);
|
||||
|
||||
Test = Child.ParentRelations [0];
|
||||
|
||||
AssertEquals ("test#05", "Rel", Test.ToString ());
|
||||
|
||||
AssertEquals ("test#06", "Rel", Test.RelationName);
|
||||
AssertEquals ("test#07", "Mom", Test.ParentTable.TableName);
|
||||
|
||||
Assert ("test#08", Test.ParentKeyConstraint == null);
|
||||
|
||||
Assert ("test#09", Test.ParentKeyConstraint == null);
|
||||
|
||||
AssertEquals ("test#10", 1, Test.ParentColumns.Length);
|
||||
AssertEquals ("test#11", false, Test.Nested);
|
||||
AssertEquals ("test#12", 0, Test.ExtendedProperties.Count);
|
||||
AssertEquals ("test#13", "Child", Test.ChildTable.TableName);
|
||||
|
||||
Assert ("test#14", Test.ChildKeyConstraint == null);
|
||||
AssertEquals ("test#15", 1, Test.ChildColumns.Length);
|
||||
AssertEquals ("test#16", 0, Mom.Constraints.Count);
|
||||
AssertEquals ("test#17", 0, Child.Constraints.Count);
|
||||
|
||||
}
|
||||
|
||||
public void TestCreation4 ()
|
||||
{
|
||||
DataSet Set = new DataSet ();
|
||||
DataTable Mom = new DataTable ("Mom");
|
||||
DataTable Child = new DataTable ("Child");
|
||||
Set.Tables.Add (Mom);
|
||||
Set.Tables.Add (Child);
|
||||
|
||||
DataColumn Col = new DataColumn ("Name");
|
||||
DataColumn Col2 = new DataColumn ("ChildName");
|
||||
Mom.Columns.Add (Col);
|
||||
Mom.Columns.Add (Col2);
|
||||
|
||||
DataColumn Col3 = new DataColumn ("Name");
|
||||
DataColumn Col4 = new DataColumn ("Age");
|
||||
Child.Columns.Add (Col3);
|
||||
Child.Columns.Add (Col4);
|
||||
|
||||
DataRelation Relation = new DataRelation ("Rel", "Mom", "Child",
|
||||
new string [] {"ChildName"},
|
||||
new string [] {"Name"}, true);
|
||||
|
||||
try {
|
||||
Set.Relations.Add (Relation);
|
||||
Fail ("test#01");
|
||||
} catch (Exception e) {
|
||||
AssertEquals ("test#02", typeof (NullReferenceException), e.GetType ());
|
||||
}
|
||||
|
||||
try {
|
||||
Set.Relations.AddRange (new DataRelation [] {Relation});
|
||||
Fail ("test#03");
|
||||
} catch (Exception e) {
|
||||
AssertEquals ("test#04", typeof (NullReferenceException), e.GetType ());
|
||||
}
|
||||
|
||||
Set.BeginInit ();
|
||||
Set.Relations.AddRange (new DataRelation [] {Relation});
|
||||
Set.EndInit ();
|
||||
|
||||
DataRelation Test = null;
|
||||
AssertEquals ("test#01", 1, Mom.ChildRelations.Count);
|
||||
AssertEquals ("test#02", 0, Child.ChildRelations.Count);
|
||||
AssertEquals ("test#03", 0, Mom.ParentRelations.Count);
|
||||
AssertEquals ("test#04", 1, Child.ParentRelations.Count);
|
||||
|
||||
Test = Child.ParentRelations [0];
|
||||
AssertEquals ("test#05", "Rel", Test.ToString ());
|
||||
AssertEquals ("test#06", "Rel", Test.RelationName);
|
||||
AssertEquals ("test#07", "Mom", Test.ParentTable.TableName);
|
||||
|
||||
AssertEquals ("test#08", true, Test.ParentKeyConstraint == null);
|
||||
|
||||
AssertEquals ("test#10", 1, Test.ParentColumns.Length);
|
||||
AssertEquals ("test#11", true, Test.Nested);
|
||||
AssertEquals ("test#12", 0, Test.ExtendedProperties.Count);
|
||||
AssertEquals ("test#13", "Child", Test.ChildTable.TableName);
|
||||
AssertEquals ("test#14", true, Test.ChildKeyConstraint == null);
|
||||
AssertEquals ("test#15", 1, Test.ChildColumns.Length);
|
||||
|
||||
}
|
||||
|
||||
public void TestRelationFromSchema ()
|
||||
{
|
||||
DataSet Set = new DataSet ();
|
||||
Set.ReadXmlSchema ("System.Data/store.xsd");
|
||||
DataTable Table = Set.Tables [0];
|
||||
|
||||
AssertEquals ("test#01", false, Table.CaseSensitive);
|
||||
AssertEquals ("test#02", 1, Table.ChildRelations.Count);
|
||||
AssertEquals ("test#03", 0, Table.ParentRelations.Count);
|
||||
AssertEquals ("test#04", 1, Table.Constraints.Count);
|
||||
AssertEquals ("test#05", 1, Table.PrimaryKey.Length);
|
||||
AssertEquals ("test#06", 0, Table.Rows.Count);
|
||||
AssertEquals ("test#07", "bookstore", Table.TableName);
|
||||
AssertEquals ("test#08", 1, Table.Columns.Count);
|
||||
|
||||
DataRelation Relation = Table.ChildRelations [0];
|
||||
AssertEquals ("test#09", 1, Relation.ChildColumns.Length);
|
||||
AssertEquals ("test#10", "bookstore_book", Relation.ChildKeyConstraint.ConstraintName);
|
||||
AssertEquals ("test#11", 1, Relation.ChildKeyConstraint.Columns.Length);
|
||||
AssertEquals ("test#12", "book", Relation.ChildTable.TableName);
|
||||
AssertEquals ("test#13", "NewDataSet", Relation.DataSet.DataSetName);
|
||||
AssertEquals ("test#14", 0, Relation.ExtendedProperties.Count);
|
||||
AssertEquals ("test#15", true, Relation.Nested);
|
||||
AssertEquals ("test#16", 1, Relation.ParentColumns.Length);
|
||||
AssertEquals ("test#17", "Constraint1", Relation.ParentKeyConstraint.ConstraintName);
|
||||
AssertEquals ("test#18", "bookstore", Relation.ParentTable.TableName);
|
||||
AssertEquals ("test#19", "bookstore_book", Relation.RelationName);
|
||||
|
||||
Table = Set.Tables [1];
|
||||
|
||||
AssertEquals ("test#20", false, Table.CaseSensitive);
|
||||
AssertEquals ("test#21", 1, Table.ChildRelations.Count);
|
||||
AssertEquals ("test#22", 1, Table.ParentRelations.Count);
|
||||
AssertEquals ("test#23", 2, Table.Constraints.Count);
|
||||
AssertEquals ("test#24", 1, Table.PrimaryKey.Length);
|
||||
AssertEquals ("test#25", 0, Table.Rows.Count);
|
||||
AssertEquals ("test#26", "book", Table.TableName);
|
||||
AssertEquals ("test#27", 5, Table.Columns.Count);
|
||||
|
||||
Relation = Table.ChildRelations [0];
|
||||
AssertEquals ("test#28", 1, Relation.ChildColumns.Length);
|
||||
AssertEquals ("test#29", "book_author", Relation.ChildKeyConstraint.ConstraintName);
|
||||
AssertEquals ("test#30", 1, Relation.ChildKeyConstraint.Columns.Length);
|
||||
AssertEquals ("test#31", "author", Relation.ChildTable.TableName);
|
||||
AssertEquals ("test#32", "NewDataSet", Relation.DataSet.DataSetName);
|
||||
AssertEquals ("test#33", 0, Relation.ExtendedProperties.Count);
|
||||
AssertEquals ("test#34", true, Relation.Nested);
|
||||
AssertEquals ("test#35", 1, Relation.ParentColumns.Length);
|
||||
AssertEquals ("test#36", "Constraint1", Relation.ParentKeyConstraint.ConstraintName);
|
||||
AssertEquals ("test#37", "book", Relation.ParentTable.TableName);
|
||||
AssertEquals ("test#38", "book_author", Relation.RelationName);
|
||||
|
||||
Table = Set.Tables [2];
|
||||
AssertEquals ("test#39", false, Table.CaseSensitive);
|
||||
AssertEquals ("test#40", 0, Table.ChildRelations.Count);
|
||||
AssertEquals ("test#41", 1, Table.ParentRelations.Count);
|
||||
AssertEquals ("test#42", 1, Table.Constraints.Count);
|
||||
AssertEquals ("test#43", 0, Table.PrimaryKey.Length);
|
||||
AssertEquals ("test#44", 0, Table.Rows.Count);
|
||||
AssertEquals ("test#45", "author", Table.TableName);
|
||||
AssertEquals ("test#46", 3, Table.Columns.Count);
|
||||
}
|
||||
|
||||
public void TestChildRows ()
|
||||
{
|
||||
DataSet Set = new DataSet ();
|
||||
DataTable Mom = new DataTable ("Mom");
|
||||
DataTable Child = new DataTable ("Child");
|
||||
Set.Tables.Add (Mom);
|
||||
Set.Tables.Add (Child);
|
||||
|
||||
DataColumn Col = new DataColumn ("Name");
|
||||
DataColumn Col2 = new DataColumn ("ChildName");
|
||||
Mom.Columns.Add (Col);
|
||||
Mom.Columns.Add (Col2);
|
||||
|
||||
DataColumn Col3 = new DataColumn ("Name");
|
||||
DataColumn Col4 = new DataColumn ("Age");
|
||||
Child.Columns.Add (Col3);
|
||||
Child.Columns.Add (Col4);
|
||||
|
||||
DataRelation Relation = new DataRelation ("Rel", Col2, Col3);
|
||||
Set.Relations.Add (Relation);
|
||||
|
||||
DataRow TempRow = Mom.NewRow ();
|
||||
TempRow [0] = "teresa";
|
||||
TempRow [1] = "john";
|
||||
Mom.Rows.Add (TempRow);
|
||||
|
||||
TempRow = Mom.NewRow ();
|
||||
TempRow [0] = "teresa";
|
||||
TempRow [1] = "Dick";
|
||||
Mom.Rows.Add (TempRow);
|
||||
|
||||
TempRow = Child.NewRow ();
|
||||
TempRow [0] = "john";
|
||||
TempRow [1] = "15";
|
||||
Child.Rows.Add (TempRow);
|
||||
|
||||
TempRow = Child.NewRow ();
|
||||
TempRow [0] = "Dick";
|
||||
TempRow [1] = "10";
|
||||
Child.Rows.Add (TempRow);
|
||||
|
||||
DataRow Row = Mom.Rows [1];
|
||||
TempRow = Row.GetChildRows ("Rel") [0];
|
||||
AssertEquals ("test#01", "Dick", TempRow [0]);
|
||||
AssertEquals ("test#02", "10", TempRow [1]);
|
||||
TempRow = TempRow.GetParentRow ("Rel");
|
||||
AssertEquals ("test#03", "teresa", TempRow [0]);
|
||||
AssertEquals ("test#04", "Dick", TempRow [1]);
|
||||
|
||||
Row = Child.Rows [0];
|
||||
TempRow = Row.GetParentRows ("Rel") [0];
|
||||
AssertEquals ("test#05", "teresa", TempRow [0]);
|
||||
AssertEquals ("test#06", "john", TempRow [1]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
2003-01-13 Ville Palo <[email protected]>
|
||||
|
||||
* XmlDataDocumentTest.cs: Added more tests
|
||||
@@ -10,7 +10,10 @@ using NUnit.Framework;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Globalization;
|
||||
|
||||
namespace MonoTests.System.Data.Xml
|
||||
{
|
||||
@@ -24,6 +27,7 @@ namespace MonoTests.System.Data.Xml
|
||||
|
||||
protected override void SetUp()
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
|
||||
}
|
||||
|
||||
public static ITest Suite {
|
||||
@@ -32,6 +36,178 @@ namespace MonoTests.System.Data.Xml
|
||||
}
|
||||
}
|
||||
|
||||
public void TestCloneNode ()
|
||||
{
|
||||
XmlDataDocument doc = new XmlDataDocument ();
|
||||
|
||||
doc.DataSet.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
doc.Load ("System.Xml/region.xml");
|
||||
|
||||
XmlDataDocument doc2 = (XmlDataDocument)doc.CloneNode (false);
|
||||
|
||||
AssertEquals ("#I01", 0, doc2.ChildNodes.Count);
|
||||
AssertEquals ("#I02", "<?xml version=\"1.0\" encoding=\"utf-16\"?>", doc2.DataSet.GetXmlSchema ().Substring (0, 39));
|
||||
|
||||
doc2 = (XmlDataDocument)doc.CloneNode (true);
|
||||
|
||||
AssertEquals ("#I03", 2, doc2.ChildNodes.Count);
|
||||
AssertEquals ("#I04", "<?xml version=\"1.0\" encoding=\"utf-16\"?>", doc2.DataSet.GetXmlSchema ().Substring (0, 39));
|
||||
|
||||
doc.DataSet.Tables [0].Rows [0][0] = "64";
|
||||
|
||||
AssertEquals ("#I05", "1", doc2.DataSet.Tables [0].Rows [0][0].ToString ());
|
||||
}
|
||||
|
||||
public void TestEditingXmlTree ()
|
||||
{
|
||||
XmlDataDocument doc = new XmlDataDocument ();
|
||||
doc.DataSet.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
doc.Load ("System.Xml/region.xml");
|
||||
|
||||
XmlElement Element = doc.GetElementFromRow (doc.DataSet.Tables [0].Rows [1]);
|
||||
Element.FirstChild.InnerText = "64";
|
||||
AssertEquals ("test#01", "64", doc.DataSet.Tables [0].Rows [1] [0]);
|
||||
|
||||
DataSet Set = new DataSet ();
|
||||
Set.ReadXml ("System.Xml/region.xml");
|
||||
doc = new XmlDataDocument (Set);
|
||||
|
||||
Element = doc.GetElementFromRow (doc.DataSet.Tables [0].Rows [1]);
|
||||
|
||||
try {
|
||||
Element.FirstChild.InnerText = "64";
|
||||
Fail ("test#02");
|
||||
} catch (Exception e) {
|
||||
AssertEquals ("test#03", typeof (InvalidOperationException), e.GetType ());
|
||||
AssertEquals ("test#04", "Please set DataSet.EnforceConstraints == false before trying to edit XmlDataDocument using XML operations.", e.Message);
|
||||
}
|
||||
|
||||
AssertEquals ("test#05", "2", doc.DataSet.Tables [0].Rows [1] [0]);
|
||||
|
||||
Set.EnforceConstraints = false;
|
||||
Element.FirstChild.InnerText = "64";
|
||||
AssertEquals ("test#06", "64", doc.DataSet.Tables [0].Rows [1] [0]);
|
||||
}
|
||||
|
||||
public void TestEditingDataSet ()
|
||||
{
|
||||
XmlReader Reader = new XmlTextReader ("System.Xml/region.xml");
|
||||
XmlDataDocument Doc = new XmlDataDocument ();
|
||||
Doc.DataSet.ReadXml (Reader);
|
||||
AssertEquals ("test#01", "Interactive", Reader.ReadState.ToString ());
|
||||
|
||||
DataSet Set = Doc.DataSet;
|
||||
Set.Tables [0].Rows [1] [0] = "64";
|
||||
AssertEquals ("test#02", "64", Doc.FirstChild.FirstChild.NextSibling.FirstChild.InnerText);
|
||||
}
|
||||
|
||||
public void TestCreateElement1 ()
|
||||
{
|
||||
XmlDataDocument doc = new XmlDataDocument ();
|
||||
doc.DataSet.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
doc.Load ("System.Xml/region.xml");
|
||||
|
||||
XmlElement Element = doc.CreateElement ("prefix", "localname", "namespaceURI");
|
||||
AssertEquals ("test#01", "prefix", Element.Prefix);
|
||||
AssertEquals ("test#02", "localname", Element.LocalName);
|
||||
AssertEquals ("test#03", "namespaceURI", Element.NamespaceURI);
|
||||
doc.ImportNode (Element, false);
|
||||
|
||||
TextWriter text = new StringWriter ();
|
||||
|
||||
doc.Save(text);
|
||||
|
||||
string substring = "";
|
||||
string TextString = text.ToString ();
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
//AssertEquals ("test#04", "<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#05", "<Root>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#06", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#07", " <RegionID>1</RegionID>", substring);
|
||||
|
||||
for (int i = 0; i < 26; i++) {
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
}
|
||||
|
||||
substring = TextString.Substring (0, TextString.Length);
|
||||
AssertEquals ("test#07", "</Root>", substring);
|
||||
}
|
||||
|
||||
public void TestCreateElement2 ()
|
||||
{
|
||||
XmlDataDocument doc = new XmlDataDocument ();
|
||||
doc.DataSet.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
doc.Load ("System.Xml/region.xml");
|
||||
|
||||
XmlElement Element = doc.CreateElement ("ElementName");
|
||||
AssertEquals ("test#01", "", Element.Prefix);
|
||||
AssertEquals ("test#02", "ElementName", Element.LocalName);
|
||||
AssertEquals ("test#03", "", Element.NamespaceURI);
|
||||
|
||||
Element = doc.CreateElement ("prefix:ElementName");
|
||||
AssertEquals ("test#04", "prefix", Element.Prefix);
|
||||
AssertEquals ("test#05", "ElementName", Element.LocalName);
|
||||
AssertEquals ("test#06", "", Element.NamespaceURI);
|
||||
}
|
||||
|
||||
public void TestCreateElement3 ()
|
||||
{
|
||||
XmlDataDocument doc = new XmlDataDocument ();
|
||||
doc.DataSet.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
doc.Load ("System.Xml/region.xml");
|
||||
|
||||
XmlElement Element = doc.CreateElement ("ElementName", "namespace");
|
||||
AssertEquals ("test#01", "", Element.Prefix);
|
||||
AssertEquals ("test#02", "ElementName", Element.LocalName);
|
||||
AssertEquals ("test#03", "namespace", Element.NamespaceURI);
|
||||
|
||||
Element = doc.CreateElement ("prefix:ElementName", "namespace");
|
||||
AssertEquals ("test#04", "prefix", Element.Prefix);
|
||||
AssertEquals ("test#05", "ElementName", Element.LocalName);
|
||||
AssertEquals ("test#06", "namespace", Element.NamespaceURI);
|
||||
}
|
||||
|
||||
public void TestNavigator ()
|
||||
{
|
||||
XmlDataDocument doc = new XmlDataDocument ();
|
||||
doc.DataSet.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
doc.Load ("System.Xml/region.xml");
|
||||
|
||||
XPathNavigator Nav = doc.CreateNavigator ();
|
||||
|
||||
Nav.MoveToRoot ();
|
||||
Nav.MoveToFirstChild ();
|
||||
|
||||
AssertEquals ("test#01", "Root", Nav.Name.ToString ());
|
||||
AssertEquals ("test#02", "", Nav.NamespaceURI.ToString ());
|
||||
AssertEquals ("test#03", "False", Nav.IsEmptyElement.ToString ());
|
||||
AssertEquals ("test#04", "Element", Nav.NodeType.ToString ());
|
||||
AssertEquals ("test#05", "", Nav.Prefix);
|
||||
|
||||
Nav.MoveToFirstChild ();
|
||||
Nav.MoveToNext ();
|
||||
AssertEquals ("test#06", "Region", Nav.Name.ToString ());
|
||||
|
||||
AssertEquals ("test#07", "2Western", Nav.Value.Substring(0, Nav.Value.IndexOf ("\n") - 1));
|
||||
Nav.MoveToFirstChild ();
|
||||
AssertEquals ("test#08", "2", Nav.Value);
|
||||
Nav.MoveToRoot ();
|
||||
AssertEquals ("test#09", "Root", Nav.NodeType.ToString ());
|
||||
|
||||
}
|
||||
|
||||
// Test constructor
|
||||
public void Test1()
|
||||
{
|
||||
@@ -120,7 +296,7 @@ namespace MonoTests.System.Data.Xml
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
|
||||
AssertEquals ("#B01", "<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>", substring);
|
||||
//AssertEquals ("#B01", "<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
@@ -318,7 +494,6 @@ namespace MonoTests.System.Data.Xml
|
||||
AssertEquals ("#C17", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.Length);
|
||||
//TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C18", "</Root>", substring);
|
||||
|
||||
}
|
||||
@@ -344,7 +519,7 @@ namespace MonoTests.System.Data.Xml
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
|
||||
AssertEquals ("#F01", "<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>", substring);
|
||||
//AssertEquals ("#F01", "<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
@@ -536,7 +711,7 @@ namespace MonoTests.System.Data.Xml
|
||||
|
||||
substring = TextString.Substring (0, TextString.Length);
|
||||
AssertEquals ("#G08", "</Root>", substring);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void Test6 ()
|
||||
@@ -559,10 +734,12 @@ namespace MonoTests.System.Data.Xml
|
||||
AssertEquals ("#H02", typeof (XmlException), e.GetType ());
|
||||
newChildNode2 = DataDoc.CreateElement ("something_else");
|
||||
}
|
||||
|
||||
newChildNode2.InnerText = "test node";
|
||||
newNode.AppendChild (newChildNode);
|
||||
newNode.AppendChild (newChildNode2);
|
||||
DataDoc.DocumentElement.AppendChild (newNode);
|
||||
|
||||
TextWriter text = new StringWriter ();
|
||||
|
||||
//DataDoc.Save (text);
|
||||
@@ -588,6 +765,7 @@ namespace MonoTests.System.Data.Xml
|
||||
|
||||
substring = TextString.Substring (0, TextString.Length);
|
||||
AssertEquals ("#H06", "</Root>", substring);
|
||||
|
||||
}
|
||||
|
||||
public void TestGetElementFromRow ()
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<xsd:element name="bookstore" type="bookstoreType"/>
|
||||
|
||||
<xsd:complexType name="bookstoreType">
|
||||
<xsd:sequence maxOccurs="unbounded">
|
||||
<xsd:element name="book" type="bookType"/>
|
||||
@@ -24,4 +22,6 @@
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
</xsd:schema>
|
||||
<xsd:element name="bookstore" type="bookstoreType"/>
|
||||
|
||||
</xsd:schema>
|
||||
@@ -18,6 +18,18 @@ System.Data.SqlTypes/SqlDateTimeTest.cs
|
||||
System.Data.SqlTypes/SqlGuidTest.cs
|
||||
System.Data.SqlTypes/SqlDecimalTest.cs
|
||||
System.Data.SqlTypes/SqlStringTest.cs
|
||||
System.Xml/XmlDataDocumentTest.cs
|
||||
System.Xml/AllTests.cs
|
||||
System.Xml/XmlDataDocumentTest.cs
|
||||
System.Data/AllTests.cs
|
||||
System.Data/DataColumnTest.cs
|
||||
System.Data/UniqueConstraintTest.cs
|
||||
System.Data/ConstraintTest.cs
|
||||
System.Data/ConstraintCollectionTest.cs
|
||||
System.Data/ForeignKeyConstraintTest.cs
|
||||
System.Data/DataTableTest.cs
|
||||
System.Data/DataRowCollectionTest.cs
|
||||
System.Data/DataRowTest.cs
|
||||
System.Data/DataColumnCollectionTest.cs
|
||||
System.Data/DataSetTest.cs
|
||||
System.Data/DataRelationTest.cs
|
||||
AllTests.cs
|
||||
@@ -1,3 +1,7 @@
|
||||
2003-01-17 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* System.Security.build: Simplified and fixed some issues.
|
||||
|
||||
2002-11-28 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* System.Security.build: New. Nant build file for Windows.
|
||||
@@ -1,3 +1,18 @@
|
||||
2003-01-17 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* KeyInfo.cs: Changed some protected declaration to private.
|
||||
* KeyInfoName.cs: Changed some protected declaration to private.
|
||||
* KeyInfoNode.cs: Changed some protected declaration to private.
|
||||
* KeyInfoRetrievalMethod.cs: Changed some protected declaration to private.
|
||||
* KeyInfoX509Data.cs: Changed some protected declaration to private.
|
||||
* Transform.cs: Changed some protected declaration to private.
|
||||
* XmlDsigBase64Transform.cs: Changed some protected declaration to private.
|
||||
* XmlDsigC14NTransform.cs: Changed some protected declaration to private.
|
||||
* XmlDsigC14NWithCommentsTransform.cs: Changed some protected declaration to private.
|
||||
* XmlDsigEnvelopedSignatureTransform.cs: Changed some protected declaration to private.
|
||||
* XmlDsigXPathTransform.cs: Changed some protected declaration to private.
|
||||
* XmlDsigXsltTransform.cs: Changed some protected declaration to private.
|
||||
|
||||
2002-11-28 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* TODOAttribute.cs: New. Still much to do ;-)
|
||||
|
||||
@@ -17,8 +17,8 @@ public class KeyInfo : IEnumerable {
|
||||
|
||||
static private string xmldsig = "http://www.w3.org/2000/09/xmldsig#";
|
||||
|
||||
protected ArrayList Info;
|
||||
protected string id;
|
||||
private ArrayList Info;
|
||||
private string id;
|
||||
|
||||
public KeyInfo()
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace System.Security.Cryptography.Xml {
|
||||
|
||||
public class KeyInfoName : KeyInfoClause {
|
||||
|
||||
protected string Name;
|
||||
private string Name;
|
||||
|
||||
public KeyInfoName() {}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace System.Security.Cryptography.Xml {
|
||||
|
||||
public class KeyInfoNode : KeyInfoClause {
|
||||
|
||||
protected XmlElement Node;
|
||||
private XmlElement Node;
|
||||
|
||||
public KeyInfoNode () {}
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ namespace System.Security.Cryptography.Xml {
|
||||
|
||||
public class KeyInfoRetrievalMethod : KeyInfoClause {
|
||||
|
||||
protected string URI;
|
||||
private string URI;
|
||||
|
||||
public KeyInfoRetrievalMethod () {}
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@ internal class IssuerSerial {
|
||||
|
||||
public class KeyInfoX509Data : KeyInfoClause {
|
||||
|
||||
protected byte[] x509crl;
|
||||
protected ArrayList IssuerSerialList;
|
||||
protected ArrayList SubjectKeyIdList;
|
||||
protected ArrayList SubjectNameList;
|
||||
protected ArrayList X509CertificateList;
|
||||
private byte[] x509crl;
|
||||
private ArrayList IssuerSerialList;
|
||||
private ArrayList SubjectKeyIdList;
|
||||
private ArrayList SubjectNameList;
|
||||
private ArrayList X509CertificateList;
|
||||
|
||||
public KeyInfoX509Data ()
|
||||
{
|
||||
@@ -153,10 +153,10 @@ public class KeyInfoX509Data : KeyInfoClause {
|
||||
return doc.DocumentElement;
|
||||
}
|
||||
|
||||
public override void LoadXml (XmlElement value)
|
||||
public override void LoadXml (XmlElement element)
|
||||
{
|
||||
if (value == null)
|
||||
throw new ArgumentNullException ();
|
||||
if (element == null)
|
||||
throw new ArgumentNullException ("element");
|
||||
|
||||
IssuerSerialList.Clear ();
|
||||
SubjectKeyIdList.Clear ();
|
||||
@@ -165,10 +165,10 @@ public class KeyInfoX509Data : KeyInfoClause {
|
||||
x509crl = null;
|
||||
|
||||
string ns = "http://www.w3.org/2000/09/xmldsig#";
|
||||
if ((value.LocalName == "X509Data") && (value.NamespaceURI == ns)) {
|
||||
if ((element.LocalName == "X509Data") && (element.NamespaceURI == ns)) {
|
||||
XmlNodeList xnl = null;
|
||||
// <X509IssuerSerial>
|
||||
xnl = value.GetElementsByTagName ("X509IssuerSerial", ns);
|
||||
xnl = element.GetElementsByTagName ("X509IssuerSerial", ns);
|
||||
if (xnl != null) {
|
||||
for (int i=0; i < xnl.Count; i++) {
|
||||
XmlElement xel = (XmlElement) xnl[i];
|
||||
@@ -178,7 +178,7 @@ public class KeyInfoX509Data : KeyInfoClause {
|
||||
}
|
||||
}
|
||||
// <X509SKI>
|
||||
xnl = value.GetElementsByTagName ("X509SKI", ns);
|
||||
xnl = element.GetElementsByTagName ("X509SKI", ns);
|
||||
if (xnl != null) {
|
||||
for (int i=0; i < xnl.Count; i++) {
|
||||
byte[] skid = Convert.FromBase64String (xnl[i].InnerXml);
|
||||
@@ -186,14 +186,14 @@ public class KeyInfoX509Data : KeyInfoClause {
|
||||
}
|
||||
}
|
||||
// <X509SubjectName>
|
||||
xnl = value.GetElementsByTagName ("X509SubjectName", ns);
|
||||
xnl = element.GetElementsByTagName ("X509SubjectName", ns);
|
||||
if (xnl != null) {
|
||||
for (int i=0; i < xnl.Count; i++) {
|
||||
AddSubjectName (xnl[i].InnerXml);
|
||||
}
|
||||
}
|
||||
// <X509Certificate>
|
||||
xnl = value.GetElementsByTagName ("X509Certificate", ns);
|
||||
xnl = element.GetElementsByTagName ("X509Certificate", ns);
|
||||
if (xnl != null) {
|
||||
for (int i=0; i < xnl.Count; i++) {
|
||||
byte[] cert = Convert.FromBase64String (xnl[i].InnerXml);
|
||||
@@ -201,13 +201,13 @@ public class KeyInfoX509Data : KeyInfoClause {
|
||||
}
|
||||
}
|
||||
// only one <X509CRL>
|
||||
xnl = value.GetElementsByTagName ("X509CRL", ns);
|
||||
xnl = element.GetElementsByTagName ("X509CRL", ns);
|
||||
if ((xnl != null) && (xnl.Count > 0)) {
|
||||
x509crl = Convert.FromBase64String (xnl[0].InnerXml);
|
||||
}
|
||||
}
|
||||
else
|
||||
throw new CryptographicException ("value");
|
||||
throw new CryptographicException ("element");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,7 @@ namespace System.Security.Cryptography.Xml {
|
||||
|
||||
public abstract class Transform {
|
||||
|
||||
protected string algo;
|
||||
protected Type[] input;
|
||||
protected Type[] output;
|
||||
private string algo;
|
||||
|
||||
public Transform () {}
|
||||
|
||||
|
||||
+3
-1
@@ -17,11 +17,13 @@ namespace System.Security.Cryptography.Xml {
|
||||
// http://www.w3.org/2000/09/xmldsig#base64
|
||||
public class XmlDsigBase64Transform : Transform {
|
||||
|
||||
private Type[] input;
|
||||
private Type[] output;
|
||||
private CryptoStream cs;
|
||||
|
||||
public XmlDsigBase64Transform ()
|
||||
{
|
||||
algo = "http://www.w3.org/2000/09/xmldsig#base64";
|
||||
Algorithm = "http://www.w3.org/2000/09/xmldsig#base64";
|
||||
}
|
||||
|
||||
public override Type[] InputTypes {
|
||||
|
||||
@@ -9,16 +9,21 @@
|
||||
//
|
||||
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
namespace System.Security.Cryptography.Xml {
|
||||
|
||||
public class XmlDsigC14NTransform : Transform {
|
||||
|
||||
protected bool comments;
|
||||
private Type[] input;
|
||||
private Type[] output;
|
||||
private bool comments;
|
||||
private Stream s;
|
||||
|
||||
public XmlDsigC14NTransform ()
|
||||
{
|
||||
Algorithm = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
|
||||
comments = false;
|
||||
}
|
||||
|
||||
@@ -62,8 +67,7 @@ public class XmlDsigC14NTransform : Transform {
|
||||
|
||||
public override object GetOutput ()
|
||||
{
|
||||
// return (object) new Stream ();
|
||||
return null;
|
||||
return (object) s;
|
||||
}
|
||||
|
||||
public override object GetOutput (Type type)
|
||||
@@ -75,12 +79,31 @@ public class XmlDsigC14NTransform : Transform {
|
||||
|
||||
public override void LoadInnerXml (XmlNodeList nodeList)
|
||||
{
|
||||
// NO CHANGE
|
||||
// documented as not changing the state of the transform
|
||||
}
|
||||
|
||||
public override void LoadInput (object obj)
|
||||
{
|
||||
// if (type.Equals (Stream.GetType ())
|
||||
XmlNodeList xnl = null;
|
||||
|
||||
if (obj is Stream)
|
||||
s = (obj as Stream);
|
||||
else if (obj is XmlDocument)
|
||||
xnl = (obj as XmlDocument).ChildNodes;
|
||||
else if (obj is XmlNodeList)
|
||||
xnl = (XmlNodeList) obj;
|
||||
|
||||
if (xnl != null) {
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
foreach (XmlNode xn in xnl)
|
||||
sb.Append (xn.InnerText);
|
||||
|
||||
UTF8Encoding utf8 = new UTF8Encoding ();
|
||||
byte[] data = utf8.GetBytes (sb.ToString ());
|
||||
s = new MemoryStream (data);
|
||||
}
|
||||
|
||||
// note: there is no default are other types won't throw an exception
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -15,7 +15,9 @@ namespace System.Security.Cryptography.Xml {
|
||||
|
||||
public class XmlDsigEnvelopedSignatureTransform : Transform {
|
||||
|
||||
protected bool comments;
|
||||
private Type[] input;
|
||||
private Type[] output;
|
||||
private bool comments;
|
||||
|
||||
public XmlDsigEnvelopedSignatureTransform ()
|
||||
{
|
||||
|
||||
@@ -20,6 +20,8 @@ namespace System.Security.Cryptography.Xml {
|
||||
// see Section 6.6.3 of the XMLDSIG specification
|
||||
public class XmlDsigXPathTransform : Transform {
|
||||
|
||||
private Type[] input;
|
||||
private Type[] output;
|
||||
private XmlNodeList xnl;
|
||||
private XmlNodeList xpathNodes;
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace System.Security.Cryptography.Xml {
|
||||
|
||||
public class XmlDsigXsltTransform : Transform {
|
||||
|
||||
private Type[] input;
|
||||
private Type[] output;
|
||||
private bool comments;
|
||||
private XmlNodeList xnl;
|
||||
private CryptoStream cs;
|
||||
@@ -27,7 +29,7 @@ public class XmlDsigXsltTransform : Transform {
|
||||
public XmlDsigXsltTransform (bool includeComments)
|
||||
{
|
||||
comments = includeComments;
|
||||
algo = "http://www.w3.org/TR/1999/REC-xslt-19991116";
|
||||
Algorithm = "http://www.w3.org/TR/1999/REC-xslt-19991116";
|
||||
}
|
||||
|
||||
public override Type[] InputTypes {
|
||||
|
||||
@@ -2,36 +2,26 @@
|
||||
|
||||
<!-- NAnt build file for System.Security.dll -->
|
||||
|
||||
<project name="System.Data" default="build">
|
||||
<project name="System.Security" default="build">
|
||||
<property name="debug" value="false"/>
|
||||
|
||||
<target name="build">
|
||||
<csc target="library" output="../lib/System.Security.dll" debug="${debug}">
|
||||
<arg value="/nowarn:1595"/>
|
||||
<arg value="/nowarn:0067"/>
|
||||
<arg value="/nowarn:0109"/>
|
||||
<arg value="/nowarn:0169"/>
|
||||
<arg value="/nowarn:0679"/>
|
||||
<arg value="/nowarn:0649"/>
|
||||
<arg value="/unsafe"/>
|
||||
<arg value="/noconfig"/>
|
||||
<arg value="/r:System.Xml.dll"/>
|
||||
<arg value="/r:..\lib\System.XML.dll"/>
|
||||
<sources basedir=".">
|
||||
<includes name="System.Security.Cryptography.Xml/*.cs"/>
|
||||
</sources>
|
||||
<references>
|
||||
<includes name="../lib/corlib.dll"/>
|
||||
<includes name="../lib/System.Xml.dll"/>
|
||||
</references>
|
||||
</csc>
|
||||
<copy file="../lib/System.Security.dll" tofile="Test/System.Security.dll"/>
|
||||
</target>
|
||||
|
||||
<target name="test" depends="build">
|
||||
<nant basedir="Test" target="test"/>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete file="../lib/System.Security.dll" failonerror="false"/>
|
||||
<delete file="Test/System.Security.dll" failonerror="false"/>
|
||||
|
||||
<nant basedir="Test" target="clean"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// TestSuite.System.Security.AllTests.cs
|
||||
// MonoTests.System.Security.AllTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Sebastien Pouliot ([email protected])
|
||||
@@ -8,10 +8,9 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.System.Security{
|
||||
namespace MonoTests.System.Security {
|
||||
|
||||
public class AllTests : TestCase {
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2003-01-17 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* AllTests.cs: Removed System.Security.Cryptography from using.
|
||||
* System.Security_test.build: Simplified and fixed some issues.
|
||||
|
||||
2002-11-28 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* AllTests.cs: New. Include System.Security.Cryptography.Xml
|
||||
|
||||
@@ -13,21 +13,18 @@
|
||||
|
||||
<target name="assemblies">
|
||||
<csc target="library" output="System.Security_test.dll" debug="${debug}">
|
||||
<arg value="/nowarn:1595"/>
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
</sources>
|
||||
<references basedir="..\..\..\nunit">
|
||||
<includes name="NUnitCore.dll"/>
|
||||
<includes name="..\class\lib\corlib.dll"/>
|
||||
<includes name="..\class\lib\System.dll"/>
|
||||
<includes name="..\class\lib\System.Xml.dll"/>
|
||||
<includes name="..\class\lib\System.XML.dll"/>
|
||||
<includes name="..\class\lib\System.Security.dll"/>
|
||||
</references>
|
||||
<arg value="/r:..\..\lib\System.dll"/>
|
||||
<arg value="/r:..\..\lib\System.Xml.dll"/>
|
||||
<arg value="/r:..\..\lib\System.Security.dll"/>
|
||||
</csc>
|
||||
<copy file="../../lib/System.Security.dll" tofile="System.Security.dll"/>
|
||||
<copy file="../../lib/System.XML.dll" tofile="System.XML.dll"/>
|
||||
</target>
|
||||
|
||||
<target name="test" depends="assemblies">
|
||||
@@ -35,7 +32,8 @@
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete file="System.Security.dll" failonerror="false"/>
|
||||
<delete file="System.Security_test.dll" failonerror="false"/>
|
||||
<delete file="System.Security.dll" failonerror="false"/>
|
||||
<delete file="System.XML.dll" failonerror="false"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -1,4 +1,8 @@
|
||||
|
||||
2003-01-08 Gaurav Vaish <gvaish_mono AT lycos.com>
|
||||
|
||||
* System.Web.Mobile.build : Also remove the pdb file.
|
||||
|
||||
2003-01-08 Gaurav Vaish <gvaish_mono AT lycos.com>
|
||||
|
||||
* .cvsignore : Ignores local files
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<delete failonerror="false">
|
||||
<fileset basedir="../lib">
|
||||
<includes name="System.Web.Mobile.dll"/>
|
||||
<includes name="System.Web.Mobile.pdb"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Class : Alignment
|
||||
* Author : Gaurav Vaish
|
||||
*
|
||||
* Copyright : 2002 with Gaurav Vaish, and with
|
||||
* Copyright : 2003 with Gaurav Vaish, and with
|
||||
* Ximian Inc
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* Project : Mono
|
||||
* Namespace : System.Web.UI.MobileControls
|
||||
* Class : ArrayListCollectionBase
|
||||
* Author : Gaurav Vaish
|
||||
*
|
||||
* Copyright : 2003 with Gaurav Vaish, and with
|
||||
* Ximian Inc
|
||||
*/
|
||||
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Web.UI.MobileControls
|
||||
{
|
||||
public class ArrayListCollectionBase : ICollection, IEnumerable
|
||||
{
|
||||
private ArrayList items;
|
||||
internal ArrayListCollectionBase()
|
||||
{
|
||||
}
|
||||
|
||||
internal ArrayListCollectionBase(ArrayList items)
|
||||
{
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return (items == null ? 0 : items.Count);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return (items == null ? false : items.IsReadOnly);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSynchronized
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public object SyncRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
protected ArrayList Items
|
||||
{
|
||||
get
|
||||
{
|
||||
if(items == null)
|
||||
items = new ArrayList();
|
||||
return items;
|
||||
}
|
||||
set
|
||||
{
|
||||
items = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyTo(Array array, int index)
|
||||
{
|
||||
Items.CopyTo(array, index);
|
||||
}
|
||||
|
||||
public IEnumerator GetEnumerator()
|
||||
{
|
||||
return Items.GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 375 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user