Compare commits

..
4 Commits
Author SHA1 Message Date
nobody 8f0db6b551 This commit was manufactured by cvs2svn to create tag 'MCS_0_18'.
svn path=/tags/MCS_0_18/mcs/; revision=10436
2003-01-12 19:15:31 +00:00
nobody 4e4824afab This commit was manufactured by cvs2svn to create branch 'SAVANNAH_CVS'.
svn path=/branches/SAVANNAH_CVS/mcs/; revision=6844
2002-08-21 10:08:33 +00:00
Martin Baulig 7f0542b133 Importing NUnit 1.11.
svn path=/branches/NUNIT/mcs/; revision=2713
2002-02-27 09:38:21 +00:00
nobody 9f187b5dd0 This commit was manufactured by cvs2svn to create branch 'NUNIT'.
svn path=/branches/NUNIT/mcs/; revision=2712
2002-02-27 09:38:18 +00:00
377 changed files with 14629 additions and 37310 deletions

No files matched your search

-45
View File
@@ -1,48 +1,3 @@
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
-107
View File
@@ -1,104 +1,3 @@
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.
@@ -207,13 +106,7 @@ 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:
+51
View File
@@ -0,0 +1,51 @@
/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
#undef HAVE_INET_PTON
#undef HAVE_INET_ATON
#undef HAVE_SOL_IP
#undef HAVE_SOL_TCP
#undef HAVE_IP_PKTINFO
#undef HAVE_STRUCT_IP_MREQN
#undef HAVE_PTHREAD
#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
#undef USE_MONO_MUTEX
#undef HAVE_LARGE_FILE_SUPPORT
#undef PLATFORM_WIN32
#undef HAVE_NEW_ICONV
#undef NAME_DEV_RANDOM
#undef HAVE_CRYPT_RNG
#undef HAVE_BOEHM_GC
/* The number of bytes in a void *. */
#undef SIZEOF_VOID_P
/* Define if you have the inet_aton function. */
#undef HAVE_INET_ATON
/* Define if you have the inet_pton function. */
#undef HAVE_INET_PTON
/* Define if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H
/* Define if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H
/* Define if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION
+2 -11
View File
@@ -1,7 +1,7 @@
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono, 0.18)
AM_INIT_AUTOMAKE(mono, 0.17)
AM_MAINTAINER_MODE
#
@@ -43,15 +43,6 @@ 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
@@ -496,7 +487,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* | powerpc-*-darwin*) TARGET=POWERPC; arch_target=ppc;;
macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | powerpc-*-sysv*) 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
View File
@@ -15,15 +15,15 @@
</configSections>
<system.web>
<httpHandlers>
<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" />
<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" />
</httpHandlers>
<httpModules>
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule, System.Web" />
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
</httpModules>
<authentication mode="Forms">
<forms name=".MONOAUTH" loginUrl="login.aspx" protection="All" timeout="30" path="/">
+57 -101
View File
@@ -1,51 +1,39 @@
* ADO.NET
<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>
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>.
* 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</li>
work with Mono
<ul>
<li>Create ADO.NET Providers
<ul>
<li><a href="http://www.go-mono.com/ibmdb2.html">IBM DB2 Universal Database</a></li>
<li><a href="http://www.go-mono.com/mysql.html">MySQL</a></li>
<li><a href="http://www.go-mono.com/odbc.html">ODBC</a></li>
<li><a href="http://www.go-mono.com/oracle.html">Oracle</a></li>
<li><a href="http://www.go-mono.com/oledb.html">OLE DB</a></li>
<li><a href="http://www.go-mono.com/postgresql.html">PostgreSQL</a></li>
<li><a href="http://www.go-mono.com/sqlclient.html">Microsoft SQL Server</a></li>
<li><a href="http://www.go-mono.com/sqlite.html">SQL Lite</a></li>
<li><a href="http://www.go-mono.com/sybase.html">Sybase</a></li>
<li><a href="http://www.go-mono.com/tdsclient.html">TDS Generic</a></li>
<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>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.</li>
some of these databases are supported via the ODBC or OLEDB providers.
<ul>
<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-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a>
<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>
@@ -53,18 +41,18 @@
<li>dbase or xbase type database files</li>
<li>Others are welcome</li>
</ul>
</ul></li>
</ul>
<br>
<li>Modify Pre-existing ADO.NET Providers to work with Mono. This may
require fixing or implementing areas of Mono too.
<ul>
<li><a href="http://www.go-mono.com/firebird.html">Firebird Interbase</a></li>
<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>
<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>
</ul>
</li>
</ul>
@@ -76,16 +64,13 @@
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. This will be
moving to its own cvs modeul sqlsharpgtk.</li>
syntax hi lighting of SQL keywords</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
@@ -108,10 +93,6 @@
<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
@@ -121,56 +102,19 @@
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. Ville Palo has been
heavily modifying DataSet, XmlDataDocument, and other classes for reading
and writing XML.
XML support in the ExecuteXmlReader() in a SqlCommand.
<p><b>ADO.NET Provider Factory</b> has been started by Brian Ritchie. The
Provider Factory is 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.
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.
<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. 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>
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>
<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
@@ -186,6 +130,27 @@
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.
@@ -229,12 +194,3 @@
</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>
+56 -33
View File
@@ -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 (embedded into
either the XSP server or the mod_mono Apache module).
programs can be run using the Mono runtime and the XSP page
parser.
We are now working bug fixing and adding missing features
after making the whole pipeline compatible with MS.
@@ -21,6 +21,41 @@
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
@@ -69,41 +104,29 @@
over the web probably do not want to use direct ASP.NET but a
wrapper around it.
* Web Forms: The pieces (historical)
** Roadmap
There are a couple of components to the puzzle:
1. The Parser.
<ul>
* .aspx page parser (converts .aspx to C# code).
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.
* System.Web.HttpRuntime support.
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...
* 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
+33 -28
View File
@@ -13,9 +13,7 @@
<ul>
* Every classes are present.
* Most classes have their unit tests. Some tests like <code>
SymmetricAlgorithmTest</code> are generated by an external
tool.
* Most classes have their unit tests.
</ul>
**** TODO
@@ -79,21 +77,20 @@
nor the certificate chain (and we're still missing some trust
anchors).
* Integration with CryptoAPI (on Windows) isn't possible as
long as the <code>X509Certificate(IntPtr)</code> constructor
isn't completed.
* Integration with CryptoAPI 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 <b>never</b>
checked!
certificate signatures and validity dates are never checked!
* The newer X509Certificate class included in Microsoft's Web
Service Enhancement (WSE) is a little better (as it includes
CryptoAPI's validation) when <code>IsCurrent</code> is called.
validation).
* Microsoft implementation of <code>X509Certificate</code> is
done by using CryptoAPI. From the exceptions thrown
@@ -105,9 +102,8 @@
*** Namespace: <b>System.Security.Cryptography.Xml</b>
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>.
This namespace implements the XML Digital Signature specification from
W3C.
**** Status
<ul>
@@ -115,25 +111,38 @@
* Most classes have their unit tests.
* This assembly is present in CVS but only available when
building using NAnt (i.e. makefile are missing).
* This assembly is present in CVS but isn't (yet) part of the
build.
</ul>
**** TODO
<ul>
* All the transforms needs to be done. But this requires far
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).
more XML knowledge than crypto.
* Makefile for building under non-Windows operating systems.
* 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.
</ul>
<hr>
** Assembly: Mono.Security.Win32
This assembly goal is to provide maximum compatibility with CryptoAPI
to application running with Mono's runtime on the Windows operating
This assembly 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>.
@@ -147,8 +156,7 @@
<ul>
* A RNGCryptoServiceProvider built on top of CryptoAPI.
* Not (yet) commited in CVS - i'm still playing with the base
classes so I can easily add other CryptoAPI-based algorithms.
* Not (yet) commited in CVS.
</ul>
**** TODO
@@ -171,8 +179,7 @@
certificates.
Note: WSE is distributed as an add-on because the WS-Security
specification isn't yet completed by
<a href="http://www.oasis-open.org/committees/wss/">OASIS</a>.
specification isn't yet completed by OASIS.
<b>There are some licensing issues to consider before stating to
implement WS-Security. All contributors must sign an agreement with
@@ -260,8 +267,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, at least in English, but you must be a good
reader if you got to this part).
(as I'm not a good writer - 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)
@@ -271,5 +278,3 @@
, <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)
+90 -137
View File
@@ -13,141 +13,6 @@
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">
@@ -167,6 +32,7 @@
<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>
@@ -182,6 +48,69 @@
</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>
@@ -199,10 +128,26 @@
</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">
@@ -245,7 +190,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>
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-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>
@@ -256,6 +201,14 @@ p <li><a href="archive/s390/libgc-6.1alpha5-1.s390.rpm">libgc-6.1alpha5-1.s390
</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>
@@ -594,4 +547,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.
+3 -78
View File
@@ -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/">here</a></li>
downloaded from <a href="http://sourceforge.net/projects/firebird/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,78 +98,3 @@
</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>
+6 -132
View File
@@ -3,145 +3,19 @@
<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
-132
View File
@@ -1,132 +0,0 @@
* 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>
-18
View File
@@ -91,24 +91,6 @@
</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
+10 -214
View File
@@ -3,32 +3,27 @@
<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</li>
the MySQL C Client Library
<li>Exists in namespace Mono.Data.MySql and assembly Mono.Data.MySql</li>
<li>Exists in namespace Mono.Data.MySql and assembly Mono.Data.MySql
<li>Works on Windows and Linux via the MySQL client shared library
(libmySQL.dll on Windows and libmysqlclient.so on Linux).</li>
(libmySQL.dll on Windows and libmysqlclient.so on Linux).
<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>Started by Daniel Morgan using C# Bindings to MySQL from Brad Meril.
<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.</li>
by Mr. Venu who is a MySQL AB developer.
<li>There is a good alternative to the provider in Mono:
<li>Other projects which have created a .NET Data provider for MySQL in C#
<ul>
<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>
<li><a href="http://sourceforge.net/projects/mysqldrivercs/">MySQLDriverCS</a> is a MySQL provider written in C#
<li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a MySQL Manager provider written in C#
</ul>
</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
@@ -53,7 +48,7 @@
can be modified with a text editor.
</ul>
** Action plan
* Action plan
The current plan to work on the MySQL data provider:
@@ -69,202 +64,3 @@ 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>
+22 -145
View File
@@ -2,174 +2,51 @@
<ul>
<li>Exists in namespace System.Data.Odbc and assembly System.Data
<li>Works on Windows and Linux. Should have no problems working on UNIX too.
<li>Works on Windows and Linux
<li>Works on Windows via the native Windows odbc32.dll
<li>Works on Linux via:
<li>Works on Linux via <a href="http://www.unixodbc.org/">unixODBC</a>
<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>List of unixODBC <a href="http://www.unixodbc.org/drivers.html">drivers</a> and
an alternative list
<li>List of unixODBC <a href="http://www.unixodbc.org/drivers.html">drivers</a>
<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 <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>
<li>Does not support trusted connections</li>
<li>ODBC Provider created by Brian Ritchie.
</ul>
** Current Status
* Current Status
<ul>
<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>Connect on Windows via native Windows odbc32.dll
<li>Connect on Linux via unixODBC's libodbc.so
<li>Various databases have been tested using their
ODBC drivers: MySQL, PostgreSQL, Oracle, IBM DB2, and Microsoft SQL Server</li>
ODBC drivers: MySQL, Oracle, IBM DB2, and Microsoft SQL Server
<li>Can execute non-query commands via ExecuteNonQuery of a OdbcCommand</li>
<li>Can execute non-query commands via ExecuteNonQuery of a OdbcCommand
<li>Can execute aggreates and retrieve a single row single column result via
ExecuteScalar of a OdbcCommand</li>
ExecuteScalar of a OdbcCommand
<li>Can execute queries via ExecuteReader of a OdbcCommand and
retrieve results using an OdbcDataReader</li>
retrieve results using an 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>
<li>Can get a DataTable containing schema info via GetSchemaTable() in a OdbcDataReader
</ul>
** Action Plan
* Action Plan
<ul>
<li>Create a Data Adapter to Fill data into a DataTable in a DataSet
<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>
<li>TODO
</ul>
+23 -112
View File
@@ -1,142 +1,53 @@
* 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.</li>
using <a href="http://www.gnome-db.org/">GDA</a> as the data access layer.
<li> Exists in namespace System.Data.OleDb and assembly System.Data</li>
<li> Exists in namespace System.Data.OleDb and assembly System.Data
<li>Created by Rodrigo Moya</li>
<li>Created by Rodrigo Moya
<li>LibGDA has providers for:</li>
<li>LibGDA has providers for:
<ul>
<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.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.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>
<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>
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>)
</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.</li>
PostgreSQL database via libgda via the C-Sharp bindings to libgda.
<li>Basic
functionality (execution of commands, data retrieval, transactions, etc) are
now working.</li>
now working.
<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.</li>
but the foundation is there.
</ul>
** Action Plan
* Action Plan
<ul>
<li>Current focus is on filling up the missing pieces (Data adapters
mainly) and schema support.</li>
mainly) and schema support.
<li>We need help building libgda on Windows though. libgda
builds find on linux though.</li>
builds find on linux though.
<li>Need to make the OleDb provider compatible with the OleDb provider in Microsoft .NET</li>
<li>Need to make the OleDb provider compatible with the OleDb provider in Microsoft .NET
</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>
+2 -96
View File
@@ -1,5 +1,4 @@
* Oracle Data Provider
<ul>
<li>Exists in namespace System.Data.OracleClient and assembly System.Data.OracleClient</li>
@@ -8,14 +7,10 @@
<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
@@ -35,7 +30,7 @@
</ul>
** Action Plan
* Action Plan
<ul>
<li>Get the makefile for the Borland C++ compiler to work
@@ -55,92 +50,3 @@
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>
+246
View File
@@ -0,0 +1,246 @@
System.Object
System.Exception
System.ValueType
System.Delegate
System.MulticastDelegate
System.Enum
System.Activator
System.ArgIterator
System.__ComObject
System.TypedReference
System.Security.AllowPartiallyTrustedCallersAttribute
System.Runtime.Serialization.Formatter
System.Runtime.Serialization.FormatterConverter
System.Runtime.Serialization.FormatterServices
System.Runtime.Serialization.ObjectIDGenerator
System.Runtime.Serialization.ObjectManager
System.Reflection.ModuleResolveEventHandler
System.Reflection.Pointer
System.Globalization.CompareInfo
System.Globalization.HebrewCalendar
System.Globalization.HijriCalendar
System.Globalization.JapaneseCalendar
System.Globalization.KoreanCalendar
System.Globalization.SortKey
System.Globalization.StringInfo
System.Globalization.TaiwanCalendar
System.Globalization.TextElementEnumerator
System.Globalization.TextInfo
System.Globalization.ThaiBuddhistCalendar
System.IO.IsolatedStorage.IsolatedStorageFile
System.Reflection.Emit.MethodRental
System.Runtime.CompilerServices.AccessedThroughPropertyAttribute
System.Runtime.CompilerServices.CallConvCdecl
System.Runtime.CompilerServices.CallConvStdcall
System.Runtime.CompilerServices.CallConvThiscall
System.Runtime.CompilerServices.CallConvFastcall
System.Runtime.CompilerServices.CustomConstantAttribute
System.Runtime.CompilerServices.DateTimeConstantAttribute
System.Runtime.CompilerServices.DiscardableAttribute
System.Runtime.CompilerServices.DecimalConstantAttribute
System.Runtime.CompilerServices.CompilationRelaxationsAttribute
System.Runtime.CompilerServices.CompilerGlobalScopeAttribute
System.Runtime.CompilerServices.IDispatchConstantAttribute
System.Runtime.CompilerServices.IsVolatile
System.Runtime.CompilerServices.IUnknownConstantAttribute
System.Runtime.CompilerServices.RequiredAttributeAttribute
System.Runtime.InteropServices.ArrayWithOffset
System.Runtime.InteropServices.DispIdAttribute
System.Runtime.InteropServices.ClassInterfaceType
System.Runtime.InteropServices.ClassInterfaceAttribute
System.Runtime.InteropServices.ComVisibleAttribute
System.Runtime.InteropServices.LCIDConversionAttribute
System.Runtime.InteropServices.ComRegisterFunctionAttribute
System.Runtime.InteropServices.ComUnregisterFunctionAttribute
System.Runtime.InteropServices.ProgIdAttribute
System.Runtime.InteropServices.ImportedFromTypeLibAttribute
System.Runtime.InteropServices.IDispatchImplType
System.Runtime.InteropServices.IDispatchImplAttribute
System.Runtime.InteropServices.ComSourceInterfacesAttribute
System.Runtime.InteropServices.ComConversionLossAttribute
System.Runtime.InteropServices.TypeLibTypeFlags
System.Runtime.InteropServices.TypeLibFuncFlags
System.Runtime.InteropServices.TypeLibVarFlags
System.Runtime.InteropServices.TypeLibTypeAttribute
System.Runtime.InteropServices.TypeLibFuncAttribute
System.Runtime.InteropServices.TypeLibVarAttribute
System.Runtime.InteropServices.ComImportAttribute
System.Runtime.InteropServices.PreserveSigAttribute
System.Runtime.InteropServices.ComAliasNameAttribute
System.Runtime.InteropServices.AutomationProxyAttribute
System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute
System.Runtime.InteropServices.CoClassAttribute
System.Runtime.InteropServices.ComEventInterfaceAttribute
System.Runtime.InteropServices.COMException
System.Runtime.InteropServices.ComMemberType
System.Runtime.InteropServices.CurrencyWrapper
System.Runtime.InteropServices.DispatchWrapper
System.Runtime.InteropServices.ErrorWrapper
System.Runtime.InteropServices.ExtensibleClassFactory
System.Runtime.InteropServices.HandleRef
System.Runtime.InteropServices.InvalidComObjectException
System.Runtime.InteropServices.InvalidOleVariantTypeException
System.Runtime.InteropServices.TypeLibImporterFlags
System.Runtime.InteropServices.ExporterEventKind
System.Runtime.InteropServices.ITypeLibExporterNotifySink
System.Runtime.InteropServices.ITypeLibConverter
System.Runtime.InteropServices.MarshalDirectiveException
System.Runtime.InteropServices.ObjectCreationDelegate
System.Runtime.InteropServices.RuntimeEnvironment
System.Runtime.InteropServices.RegistrationServices
System.Runtime.InteropServices.SafeArrayRankMismatchException
System.Runtime.InteropServices.SafeArrayTypeMismatchException
System.Runtime.InteropServices.SEHException
System.Runtime.InteropServices.TypeLibConverter
System.Runtime.InteropServices.BIND_OPTS
System.Runtime.InteropServices.UCOMIBindCtx
System.Runtime.InteropServices.UCOMIConnectionPointContainer
System.Runtime.InteropServices.UCOMIConnectionPoint
System.Runtime.InteropServices.UCOMIEnumMoniker
System.Runtime.InteropServices.CONNECTDATA
System.Runtime.InteropServices.UCOMIEnumConnections
System.Runtime.InteropServices.UCOMIEnumConnectionPoints
System.Runtime.InteropServices.UCOMIEnumString
System.Runtime.InteropServices.UCOMIEnumVARIANT
System.Runtime.InteropServices.FILETIME
System.Runtime.InteropServices.UCOMIMoniker
System.Runtime.InteropServices.UCOMIPersistFile
System.Runtime.InteropServices.UCOMIRunningObjectTable
System.Runtime.InteropServices.STATSTG
System.Runtime.InteropServices.UCOMIStream
System.Runtime.InteropServices.DESCKIND
System.Runtime.InteropServices.BINDPTR
System.Runtime.InteropServices.UCOMITypeComp
System.Runtime.InteropServices.TYPEKIND
System.Runtime.InteropServices.TYPEFLAGS
System.Runtime.InteropServices.IMPLTYPEFLAGS
System.Runtime.InteropServices.TYPEATTR
System.Runtime.InteropServices.FUNCDESC
System.Runtime.InteropServices.IDLFLAG
System.Runtime.InteropServices.IDLDESC
System.Runtime.InteropServices.PARAMFLAG
System.Runtime.InteropServices.PARAMDESC
System.Runtime.InteropServices.TYPEDESC
System.Runtime.InteropServices.ELEMDESC
System.Runtime.InteropServices.VARDESC
System.Runtime.InteropServices.DISPPARAMS
System.Runtime.InteropServices.EXCEPINFO
System.Runtime.InteropServices.FUNCKIND
System.Runtime.InteropServices.INVOKEKIND
System.Runtime.InteropServices.CALLCONV
System.Runtime.InteropServices.FUNCFLAGS
System.Runtime.InteropServices.VARFLAGS
System.Runtime.InteropServices.UCOMITypeInfo
System.Runtime.InteropServices.SYSKIND
System.Runtime.InteropServices.LIBFLAGS
System.Runtime.InteropServices.TYPELIBATTR
System.Runtime.InteropServices.UCOMITypeLib
System.Runtime.InteropServices.UnknownWrapper
System.Runtime.Remoting.IObjectHandle
System.Runtime.Remoting.IRemotingTypeInfo
System.Runtime.Remoting.IChannelInfo
System.Runtime.Remoting.IEnvoyInfo
System.Runtime.Remoting.RemotingConfiguration
System.Runtime.Remoting.TypeEntry
System.Runtime.Remoting.ActivatedClientTypeEntry
System.Runtime.Remoting.ActivatedServiceTypeEntry
System.Runtime.Remoting.WellKnownClientTypeEntry
System.Runtime.Remoting.WellKnownServiceTypeEntry
System.Runtime.Remoting.RemotingException
System.Runtime.Remoting.ServerException
System.Runtime.Remoting.RemotingTimeoutException
System.Runtime.Remoting.RemotingServices
System.Runtime.Remoting.InternalRemotingServices
System.Runtime.Remoting.SoapServices
System.Runtime.Remoting.Activation.UrlAttribute
System.Runtime.Remoting.Messaging.IMessageSink
System.Runtime.Remoting.Messaging.AsyncResult
System.Runtime.Remoting.Messaging.CallContext
System.Runtime.Remoting.Messaging.ILogicalThreadAffinative
System.Runtime.Remoting.Messaging.InternalMessageWrapper
System.Runtime.Remoting.Messaging.IMethodCallMessage
System.Runtime.Remoting.Messaging.MethodCallMessageWrapper
System.Runtime.Remoting.Messaging.HeaderHandler
System.Runtime.Remoting.Messaging.IMessageCtrl
System.Runtime.Remoting.Messaging.IRemotingFormatter
System.Runtime.Remoting.Messaging.ReturnMessage
System.Runtime.Remoting.Messaging.MethodCall
System.Runtime.Remoting.Messaging.ConstructionCall
System.Runtime.Remoting.Messaging.MethodResponse
System.Runtime.Remoting.Messaging.ConstructionResponse
System.Runtime.Remoting.Messaging.MethodReturnMessageWrapper
System.Runtime.Remoting.Messaging.OneWayAttribute
System.Runtime.Remoting.Messaging.MessageSurrogateFilter
System.Runtime.Remoting.Messaging.RemotingSurrogateSelector
System.Runtime.Remoting.Contexts.CrossContextDelegate
System.Runtime.Remoting.Contexts.ContextProperty
System.Runtime.Remoting.Contexts.IContextPropertyActivator
System.Runtime.Remoting.Contexts.IContributeClientContextSink
System.Runtime.Remoting.Contexts.IContributeDynamicSink
System.Runtime.Remoting.Contexts.IContributeEnvoySink
System.Runtime.Remoting.Contexts.IContributeObjectSink
System.Runtime.Remoting.Contexts.IContributeServerContextSink
System.Runtime.Serialization.Formatters.InternalRM
System.Runtime.Serialization.Formatters.InternalST
System.Runtime.Serialization.Formatters.SoapMessage
System.Runtime.Serialization.Formatters.SoapFault
System.Runtime.Serialization.Formatters.ServerFault
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
System.Security.Cryptography.CryptoConfig
System.Security.Cryptography.KeyedHashAlgorithm
System.Security.Cryptography.HMACSHA1
System.Security.Cryptography.MACTripleDES
System.Security.Cryptography.MaskGenerationMethod
System.Security.Cryptography.PasswordDeriveBytes
System.Security.Cryptography.PKCS1MaskGenerationMethod
System.Security.Cryptography.RC2
System.Security.Cryptography.RC2CryptoServiceProvider
System.Security.Cryptography.RSACryptoServiceProvider
System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter
System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter
System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter
System.Security.Cryptography.RSAPKCS1SignatureDeformatter
System.Security.Cryptography.RSAPKCS1SignatureFormatter
System.Security.Cryptography.SHA1Managed
System.Security.Cryptography.TripleDES
System.Security.Cryptography.TripleDESCryptoServiceProvider
System.Security.Permissions.EnvironmentPermission
System.Security.Permissions.FileDialogPermission
System.Security.Permissions.IsolatedStorageFilePermission
System.Security.Permissions.PrincipalPermissionAttribute
System.Security.Permissions.SecurityPermissionAttribute
System.Security.Permissions.PublisherIdentityPermissionAttribute
System.Security.Permissions.PublisherIdentityPermission
System.Security.Permissions.ReflectionPermission
System.Security.Permissions.RegistryPermission
System.Security.Permissions.PrincipalPermission
System.Security.Permissions.SiteIdentityPermission
System.Security.Permissions.StrongNameIdentityPermission
System.Security.Permissions.StrongNamePublicKeyBlob
System.Security.Permissions.UIPermission
System.Security.Permissions.UrlIdentityPermission
System.Security.Permissions.ZoneIdentityPermission
System.Security.Policy.ApplicationDirectory
System.Security.Policy.ApplicationDirectoryMembershipCondition
System.Security.Policy.FirstMatchCodeGroup
System.Security.Policy.Hash
System.Security.Policy.HashMembershipCondition
System.Security.Policy.NetCodeGroup
System.Security.Policy.PermissionRequestEvidence
System.Security.Policy.Publisher
System.Security.Policy.PublisherMembershipCondition
System.Security.Policy.Site
System.Security.Policy.SiteMembershipCondition
System.Security.Policy.StrongName
System.Security.Policy.StrongNameMembershipCondition
System.Security.Policy.UnionCodeGroup
System.Security.Policy.Url
System.Security.Policy.UrlMembershipCondition
System.Security.Policy.Zone
System.Security.Policy.ZoneMembershipCondition
System.Security.Principal.WindowsIdentity
System.Security.Principal.WindowsImpersonationContext
System.Security.Principal.WindowsPrincipal
System.Threading.CompressedStack
+214 -194
View File
@@ -1,27 +1,16 @@
* PostgreSQL Data Provider
<ul>
<li>Exists in namespace Mono.Data.PostgreSql and assembly Mono.Data.PostgreSql</li>
<li>Exists in namespace Mono.Data.PostgreSql and assembly Mono.Data.PostgreSql
<li>Is a Mono Data Provider for the <a href="http://www.postgresql.org/">PostgreSQL</a>
client/server database management system.</li>
client/server database management system.
<li>Written in C# and has C# bindings to the PostgreSQL C Client library pq.dll on Windows
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>
and libpq.so on Linux.
</ul>
** Current Status
* Current Status
<ul>
<li>We are able to do simple CREATE TABLE, DROP TABLE, UPDATE, INSERT, and
@@ -81,23 +70,12 @@
See the test mcs/class/System.Data/Test/TestSqlDataAdapter.cs to see it in action.
</ul>
** 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
* Testing the PostgreSQL Provider
<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 the first ADO.NET provider created in Mono.
one locally. PostgreSQL was 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
@@ -116,9 +94,7 @@
user "postgres".
<pre>
"Server=localhost;Database=test;User ID=postgres;Password=fun2db"
(or)
"host=localhost;dbname=test;user=postgres;password=fun2db"
"host=localhost;dbname=test;user=postgres"
</pre>
</ul>
@@ -203,15 +179,9 @@ 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/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><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>The cygipc package contains the support to run ipc-daemon
that you will need
<p>The cygipc package contains the ipc-daemon you will need
to run before you can
run the PostgreSQL DBMS Server daemon (postmaster) or run
initdb which initializes the PostgreSQL database.
@@ -297,9 +267,34 @@ create user postgres with password 'fun2db';
</ul>
<p>In the path mcs/class/System.Data/Test
there is a test for Mono.Data.PostgreSqlClient named
there is a PostgreSQL test program 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:
@@ -315,7 +310,7 @@ create user postgres with password 'fun2db';
to PgSqlConnection, then you need to run mcs like:
<pre>
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
mono f:/cygwin/home/DanielMorgan/mono/install/bin/mcs.exe \
PostgresTest.cs \
-r System.Data.dll \
-r Mono.Data.PostgreSqlClient.dll
@@ -333,160 +328,185 @@ mint PostgresTest.exe
To run using mono, do:
<pre>
mono PostgresTest.exe
</pre>
</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>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>
</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>
<p>
<pre>
** Testing Npgsql
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
<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>
* Action Plan
<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.
+23 -112
View File
@@ -1,147 +1,58 @@
* Microsoft SQL Server Provider
<ul>
<li>ADO.NET Provider for Microsoft SQL Server 7/2000 databases</li>
<li>ADO.NET Provider for Microsoft SQL Server 7/2000 databases
<li>Exists in namespace System.Data.SqlClient and assembly System.Data</li>
<li>Exists in namespace System.Data.SqlClient and assembly System.Data
<li>Created by Tim Coleman</li>
<li>Created by Tim Coleman
<li>Used the <a href="http://www.freetds.org/">FreeTDS</a> and
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.</li>
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.
<li>Implemented in 100% C#</li>
<li>Implemented in 100% C#
<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>
<li>Is similar to the Mono.Data.TdsClient and Mono.Data.SybaseClient providers.
</ul>
** Current Status
* Current Status
<ul>
<li>Able to connect to Microsoft SQL Server 7/2000 databases</li>
<li>Able to connect to Microsoft SQL Server 7/2000 databases
<li>Connection pooling works.</li>
<li>Connection pooling works.
<li>Stored Procedures work</li>
<li>Stored Procedures work
<li>Parameters work.</li>
<li>Parameters work.
<li>Prepare works.</li>
<li>Prepare works.
<li>SQL commands can be executed
via ExecuteNonQuery() of a SqlCommand.</li>
via ExecuteNonQuery() of a SqlCommand.
<li>SQL aggregates can be executed and a single row and single column
result can be retrieved via ExecuteScalar() of a SqlCommand</li>
result can be retrieved via ExecuteScalar() of a SqlCommand
<li>SQL queries can be executed via ExecuteReader() and results
can be retrieved via SqlDataReader.</li>
can be retrieved via SqlDataReader.
<li>a DataTable with schema info about a result can be gotten via GetSchemaTable()
in a SqlDataReader</li>
in a SqlDataReader
<li>XML can be read via ExecuteXmlReader in a SqlCommand.</li>
<li>XML can be read via ExecuteXmlReader in a SqlCommand.
<li>Data can be filled in a DataTable in a DataSet via a SqlDataAdapter</li>
<li>Data can be filled in a DataTable in a DataSet via a SqlDataAdapter
<li>Uses TDS Protocol Version 7.0</li>
<li>Uses TDS Protocol Version 7.0
<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>
<li><a href="http://www.go-mono.com/tds-providers.html">Design of the Microsoft SQL Server, Sybase, and TDS Providers in Mono</a>
</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 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>
+9 -93
View File
@@ -1,112 +1,28 @@
* SQL Lite Data Provider
<ul>
<li>Exists in namespace and assembly Mono.Data.SqliteClient</li>
<li>Exists in namespace and assembly Mono.Data.SqliteClient
<li>Created by Vladimir Vukicevic</li>
<li>Created by Vladimir Vukicevic
<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.</li>
and sqlite.so on Linux.
</ul>
** Current Status
* Current Status
<ul>
<li>Able to connect, execute commands, and retrieve data...</li>
<li>Able to connect, execute commands, and retrieve data...
<li>Works in mPhoto by providing access to a SQL Lite database to store images.</li>
<li>Works in mPhoto
</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</li>
Fill a DataTable in a DataSet
<li>Get the method GetSchemaTable() in class SqliteDataReader to return a DataTable
that works</li>
<li>TODO
</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>
+17 -103
View File
@@ -1,134 +1,48 @@
* Sybase Data Provider
<ul>
<li>ADO.NET Provider for Sybase SQL Server databases</li>
<li>ADO.NET Provider for Sybase SQL Server databases
<li>Exists in namespace Mono.Data.SybaseClient and assembly Mono.Data.SybaseClient</li>
<li>Exists in namespace Mono.Data.SybaseClient and assembly Mono.Data.SybaseClient
<li>Created by Tim Coleman</li>
<li>Created by Tim Coleman
<li>Used the <a href="http://www.freetds.org/">FreeTDS</a> and
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.</li>
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.
<li>Implemented in 100% C#</li>
<li>Implemented in 100% C#
<li>Is similar to the Mono.Data.TdsClient and System.Data.SqlClient providers.</li>
<li>Is similar to the Mono.Data.TdsClient and System.Data.SqlClient providers.
<li>Requires the assembly Mono.Data.Tds.dll which implements the TDS protocol in 100% C#.</li>
<li>Uses TDS Protocol Version 5.0
<li>Uses TDS Protocol Version 5.0</li>
<li>Does not support trusted connections</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>
</ul>
** Current Status
* Current Status
<ul>
<li>Able to connect to Sybase databases</li>
<li>Able to connect to Sybase databases
<li>SQL commands can be executed
via ExecuteNonQuery() of a SybaseCommand.</li>
via ExecuteNonQuery() of a SybaseCommand.
<li>SQL aggregates can be executed and a single row and single column
result can be retrieved via ExecuteScalar() of a SybaseCommand</li>
result can be retrieved via ExecuteScalar() of a SybaseCommand
<li>SQL queries can be executed via ExecuteReader() and results
can be retrieved via SybaseDataReader.</li>
can be retrieved via SybaseDataReader.
<li>a DataTable with schema info about a result can be gotten via GetSchemaTable()
in a SybaseDataReader</li>
in a SybaseDataReader
<li>Data can be filled in a DataTable in a DataSet via a SybaseDataAdapter</li>
<li>Data can be filled in a DataTable in a DataSet via a SybaseDataAdapter
</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>
+19 -105
View File
@@ -1,137 +1,51 @@
* TDS Generic Provider
<ul>
<li>ADO.NET Provider for older Sybase and Microsoft SQL Server databases</li>
<li>ADO.NET Provider for older Sybase and Microsoft SQL Server databases
<li>Exists in namespace Mono.Data.TdsClient and assembly Mono.Data.TdsClient</li>
<li>Exists in namespace Mono.Data.TdsClient and assembly Mono.Data.TdsClient
<li>Created by Tim Coleman</li>
<li>Created by Tim Coleman
<li>Used the <a href="http://www.freetds.org/">FreeTDS</a> and
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.</li>
<a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.
<li>Implemented in 100% C#</li>
<li>Implemented in 100% C#
<li>Is similar to the Mono.Data.SybaseClient and System.Data.SqlClient providers.</li>
<li>Is similar to the Mono.Data.SybaseClient and System.Data.SqlClient providers.
<li>Requires the assembly Mono.Data.Tds.dll which implements the TDS protocol in 100% C#.</li>
<li>Uses TDS Protocol Version 4.2 by default
<li>Uses TDS Protocol Version 4.2 by default</li>
<li>Does not support trusted connections</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>
</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.</li>
has problems with code that is internal.
<li>Able to connect to Microsoft SQL Server and Sybase databases</li>
<li>Able to connect to Microsoft SQL Server and Sybase databases
<li>SQL commands can be executed
via ExecuteNonQuery() of a TdsCommand.</li>
via ExecuteNonQuery() of a TdsCommand.
<li>SQL aggregates can be executed and a single row and single column
result can be retrieved via ExecuteScalar() of a TdsCommand</li>
result can be retrieved via ExecuteScalar() of a TdsCommand
<li>SQL queries can be executed via ExecuteReader() and results
can be retrieved via TdsDataReader.</li>
can be retrieved via TdsDataReader.
<li>a DataTable with schema info about a result can be gotten via GetSchemaTable()
in a TdsDataReader</li>
in a TdsDataReader
<li>Data can be filled in a DataTable in a DataSet via a TdsDataAdapter</li>
<li>Data can be filled in a DataTable in a DataSet via a TdsDataAdapter
</ul>
** Action plan
* Action plan
<ul>
<li>Connection timeouts is being developed now.</li>
<li>Connection timeouts is being developed now.
<li>TODO</li>
<li>TODO
</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>
+1 -2
View File
@@ -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,7 +44,6 @@
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
-1
View File
@@ -6,7 +6,6 @@ CORCOMPARE=../../../mcs/tools/corcompare
OBJECTS= \
deploy/ado-net.html \
deploy/firebird.html \
deploy/ibmdb2.html \
deploy/mysql.html \
deploy/odbc.html \
deploy/oledb.html \
+9 -21
View File
@@ -342,28 +342,16 @@ ption defaulting to true.
.SH PROVIDERS
.nf
PROVIDER NAME NAMESPACE ASSEMBLY
PROVIDER NAME NAMESPACE ASSEMBLY
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
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
.fi
.SH CONNECTION STRING SAMPLES
-14
View File
@@ -1,17 +1,3 @@
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.
-9
View File
@@ -1,12 +1,3 @@
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,10 +3,8 @@
//
// Author:
// Chris J Breisch ([email protected])
// Francesco Delfino ([email protected])
//
// (C) 2002 Chris J Breisch
// 2002 [email protected]
//
using System;
@@ -15,107 +13,29 @@ 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 {
return pHelpContext;
}
set {
pHelpContext = value;
}
}
public System.Int32 HelpContext { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
[MonoTODO]
public System.Int32 LastDllError {
get {
return pLastDllError;
}
}
public System.Int32 LastDllError { get { throw new NotImplementedException (); } }
[MonoTODO]
public System.Int32 Number {
get {
return pNumber;
}
set {
pNumber = value;
}
}
public System.Int32 Number { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
[MonoTODO]
public System.Int32 Erl {
get {
return pErl;
}
}
public System.Int32 Erl { get { throw new NotImplementedException (); } }
[MonoTODO]
public System.String Source {
get {
return pSource;
}
set {
pSource = value;
}
}
public System.String Source { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
[MonoTODO]
public System.String HelpFile {
get {
return pHelpFile;
}
set {
pHelpFile = value;
}
}
public System.String HelpFile { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
[MonoTODO]
public System.String Description {
get {
return pDescription;
}
set {
pDescription = value;
}
}
public System.String Description { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
// 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 ()
{
return pException;
}
public System.Exception GetException () { throw new NotImplementedException (); }
[MonoTODO]
public void Clear () {
pHelpContext=0;
pLastDllError=0;
pNumber=0;
pErl=0;
pSource="";
pHelpFile="";
pDescription="";
pException= null;
}
public void Clear () { throw new NotImplementedException (); }
[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,421 +2,188 @@
// FileSystem.cs
//
// Author:
//
// Daniel Campos ( [email protected] )
//
// Chris J Breisch ([email protected])
//
using System;
using System.IO;
// (C) 2002 Chris J Breisch
//
using System;
namespace Microsoft.VisualBasic
{
[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
};
}
{
[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
};
}
@@ -3,10 +3,8 @@
//
// Author:
// Chris J Breisch ([email protected])
// Francesco Delfino ([email protected]
//
// (C) 2002 Chris J Breisch
// 2003 Tipic, Inc. (http://www.tipic.com)
//
using System;
@@ -20,9 +18,7 @@ namespace Microsoft.VisualBasic
// Properties
// Methods
[MonoTODO]
public static Microsoft.VisualBasic.ErrObject Err () {
return Microsoft.VisualBasic.CompilerServices.ProjectData.Err;
}
public static Microsoft.VisualBasic.ErrObject Err () { throw new NotImplementedException (); }
[MonoTODO]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static System.Int32 Erl () { throw new NotImplementedException (); }
@@ -3,15 +3,13 @@
//
// 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]
@@ -21,12 +19,8 @@ namespace Microsoft.VisualBasic.CompilerServices
// Properties
// Methods
public static System.Boolean FromString (System.String Value) { return System.Boolean.Parse(Value); }
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);
}
[MonoTODO]
public static System.Boolean FromObject (System.Object Value) { throw new NotImplementedException(); }
// Events
};
}
@@ -3,15 +3,13 @@
//
// 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]
@@ -21,13 +19,8 @@ namespace Microsoft.VisualBasic.CompilerServices
// Properties
// Methods
public static System.Byte FromString (System.String Value) { return System.Byte.Parse(Value); }
public static System.Byte FromObject (System.Object Value)
{
if ((object)Value == null) return 0;
else return System.Convert.ToByte(Value);
}
[MonoTODO]
public static System.Byte FromObject (System.Object Value) { throw new NotImplementedException(); }
// Events
};
}
@@ -3,15 +3,13 @@
//
// 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)]
@@ -21,16 +19,10 @@ namespace Microsoft.VisualBasic.CompilerServices
// Properties
// Methods
public static System.DateTime FromString (System.String Value) { return System.DateTime.Parse(Value); }
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);
}
[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 (); }
// Events
};
}
@@ -3,15 +3,13 @@
//
// 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)]
@@ -21,13 +19,8 @@ namespace Microsoft.VisualBasic.CompilerServices
// Properties
// Methods
public static System.Int32 FromString (System.String Value) { return System.Int32.Parse(Value); }
public static System.Int32 FromObject (System.Object Value)
{
if ((object)Value==null)
return 0;
else return System.Convert.ToInt32(Value);
}
[MonoTODO]
public static System.Int32 FromObject (System.Object Value) { throw new NotImplementedException (); }
// Events
};
}
@@ -3,15 +3,13 @@
//
// 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 {
@@ -1,98 +1,80 @@
//
// 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
}
*/
}
}
//
// 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
}
*/
}
}
@@ -3,15 +3,13 @@
//
// 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]
@@ -20,67 +18,36 @@ namespace Microsoft.VisualBasic.CompilerServices
// Constructors
// Properties
// Methods
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.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 (); }
[MonoTODO]
public static System.Boolean StrLike (System.String Source, System.String Pattern, Microsoft.VisualBasic.CompareMethod CompareOption) { throw new NotImplementedException (); }
[MonoTODO]
@@ -4,12 +4,8 @@
// 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;
@@ -40,11 +36,12 @@ 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 Char)
public static int Asc(char String)
{
//FIXME: Check the docs, it says something about Locales, DBCS, etc.
return (int)Char;
throw new NotImplementedException();
}
/// <summary>
@@ -54,8 +51,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 at least one.", "String");
if ((String == null) || (String.Length != 1))
throw new ArgumentException("Length of argument 'String' must be one.", "String");
//FIXME: Check the docs, it says something about Locales, DBCS, etc.
return (int) String.ToCharArray(0, 1)[0];
@@ -280,7 +277,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>
@@ -338,7 +335,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>
@@ -366,7 +363,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>
@@ -410,23 +407,6 @@ 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.
@@ -465,13 +445,14 @@ 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 String1.IndexOf(String2, Start - 1) + 1;
return String2.IndexOf(String1, Start - 1) + 1;
default:
throw new System.ArgumentException("Argument 'Compare' must be CompareMethod.Binary or CompareMethod.Text.", "Compare");
}
@@ -484,7 +465,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,
@@ -740,7 +721,8 @@ namespace Microsoft.VisualBasic
if ((Str == null) || (Str.Length == 0))
return String.Empty; // VB.net does this.
return Str.TrimStart(null);
Str.TrimStart(null);
return Str;
}
/// <summary>
@@ -753,7 +735,8 @@ namespace Microsoft.VisualBasic
if ((Str == null) || (Str.Length == 0))
return String.Empty; // VB.net does this.
return Str.TrimEnd(null);
Str.TrimEnd(null);
return Str;
}
/// <summary>
@@ -766,7 +749,8 @@ namespace Microsoft.VisualBasic
if ((Str == null) || (Str.Length == 0))
return String.Empty; // VB.net does this.
return Str.Trim();
Str.Trim();
return Str;
}
/// <summary>
@@ -824,7 +808,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,
@@ -869,7 +853,8 @@ namespace Microsoft.VisualBasic
if (Length < 0)
throw new ArgumentException("Argument 'Length' must be greater or equal to zero.", "Length");
return Str.Substring (Str.Length - Length);
//FIXME
throw new NotImplementedException();
}
/// <summary>
@@ -908,7 +893,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,
@@ -1074,26 +1059,27 @@ 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)
{
// 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;
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);
}
/// <summary>
@@ -3,10 +3,8 @@
//
// Author:
// Chris J Breisch ([email protected])
// Francesco Delfino ([email protected])
//
// (C) 2002 Chris J Breisch
// (C) 2002 Tipic Inc
//
using System;
@@ -17,37 +15,15 @@ namespace Microsoft.VisualBasic {
// Declarations
// Constructors
// Properties
static Random rnd = new Random();
static float last = (float)rnd.NextDouble();
// Methods
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);
}
[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 (); }
// Events
};
}
-4
View File
@@ -1,7 +1,3 @@
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;
MethodBase mb = (MethodBase) mbuilder_array [index];
MethodBuilder mb = (MethodBuilder) mbuilder_array [index];
current_method = new SourceMethod (mb);
-27
View File
@@ -1,27 +0,0 @@
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]>.
@@ -1,44 +0,0 @@
<?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>
@@ -1,58 +0,0 @@
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("")]
@@ -1,279 +0,0 @@
#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
}
}
@@ -1,229 +0,0 @@
#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;
}
}
}
@@ -1,75 +0,0 @@
#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;
}
}
@@ -1,458 +0,0 @@
#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
}
}
@@ -1,57 +0,0 @@
#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;
}
}
}
}
@@ -1,53 +0,0 @@
#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);
}
}
@@ -1,100 +0,0 @@
#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;
}
}
}
@@ -1,48 +0,0 @@
#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.

Before

Width:  |  Height:  |  Size: 1.1 KiB

@@ -1,6 +0,0 @@
2003-01-18 Daniel Morgan <[email protected]>
* TestDB2Conn.cs: use a different connection string
which uses the format
"DSN=database;UID=userid;PWD=password"
@@ -1,93 +0,0 @@
#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.");
}
}
}
}
-18
View File
@@ -1,18 +0,0 @@
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.
-9
View File
@@ -1,9 +0,0 @@
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
@@ -1,12 +0,0 @@
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
View File
@@ -1,7 +1,6 @@
AssemblyInfo.cs
ArgumentProcessorAttribute.cs
AboutAttribute.cs
ArgumentProcessorAttribute.cs
AuthorAttribute.cs
OptionAttribute.cs
UsageComplementAttribute.cs
-10
View File
@@ -1,13 +1,3 @@
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,7 +518,6 @@ 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,29 +1,3 @@
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 = Type.GetType ("System.String");
private object _defaultValue = DBNull.Value;
private string expression = "";
private Type _dataType = null;
private object _defaultValue = null;
private string expression = null;
private PropertyCollection _extendedProperties = new PropertyCollection ();
private int maxLength = -1; //-1 represents no length limit
private string nameSpace = "";
private string nameSpace = null;
private int _ordinal = -1; //-1 represents not part of a collection
private string prefix = "";
private string prefix = null;
private bool readOnly = false;
private DataTable _table = null;
private bool unique = false;
@@ -37,12 +37,7 @@ namespace System.Data
/// </summary>
public DataRow this[int index]
{
get {
if (index >= Count)
throw new IndexOutOfRangeException ("There is no row at position " + index + ".");
return (DataRow) list[index];
}
get { return (DataRow) list[index]; }
}
/// <summary>
+28 -160
View File
@@ -17,7 +17,6 @@ using System;
using System.Collections;
using System.ComponentModel;
using System.Globalization;
using System.Threading;
using System.IO;
using System.Runtime.Serialization;
using System.Xml;
@@ -32,7 +31,7 @@ namespace System.Data {
public class DataSet : MarshalByValueComponent, IListSource,
ISupportInitialize, ISerializable {
private string dataSetName = "NewDataSet";
private string dataSetName;
private string _namespace = "";
private string prefix;
private bool caseSensitive;
@@ -203,47 +202,12 @@ namespace System.Data {
public virtual DataSet Clone()
{
DataSet Copy = new DataSet ();
CopyProperties (Copy);
foreach (DataTable Table in Tables) {
Copy.Tables.Add (Table.Clone ());
}
return Copy;
throw new NotImplementedException ();
}
// Copies both the structure and data for this DataSet.
public DataSet Copy()
{
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;
throw new NotImplementedException ();
}
public DataSet GetChanges()
@@ -259,16 +223,12 @@ namespace System.Data {
public string GetXml()
{
StringWriter Writer = new StringWriter ();
WriteXml (Writer, XmlWriteMode.IgnoreSchema);
return Writer.ToString ();
return "Fish!";
}
public string GetXmlSchema()
{
StringWriter Writer = new StringWriter ();
WriteXmlSchema (Writer);
return Writer.ToString ();
throw new NotImplementedException ();
}
public virtual void RejectChanges()
@@ -309,6 +269,7 @@ namespace System.Data {
public void WriteXml(XmlWriter writer)
{
WriteXml( writer, XmlWriteMode.IgnoreSchema );
writer.Close ();
}
public void WriteXml(Stream stream, XmlWriteMode mode)
@@ -368,6 +329,7 @@ namespace System.Data {
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close ();
}
public void WriteXmlSchema(Stream stream)
@@ -401,6 +363,7 @@ namespace System.Data {
DoWriteXmlSchema( writer );
writer.WriteEndDocument();
writer.Close ();
}
public void ReadXmlSchema(Stream stream)
@@ -425,6 +388,7 @@ namespace System.Data {
{
XmlSchemaMapper SchemaMapper = new XmlSchemaMapper (this);
SchemaMapper.Read (reader);
reader.Close ();
}
public XmlReadMode ReadXml (Stream stream)
@@ -445,32 +409,9 @@ namespace System.Data {
public XmlReadMode ReadXml (XmlReader r)
{
XmlDataLoader Loader = new XmlDataLoader (this);
// 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);
XmlReadMode Result = Loader.LoadData (r);
r.Close ();
return Result;
}
public XmlReadMode ReadXml (Stream stream, XmlReadMode mode)
@@ -491,19 +432,8 @@ namespace System.Data {
[MonoTODO]
public XmlReadMode ReadXml (XmlReader reader, XmlReadMode 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;
XmlDataLoader Loader = new XmlDataLoader (this);
return Loader.LoadData (reader, mode);
}
#endregion // Public Methods
@@ -565,30 +495,14 @@ 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 )
@@ -626,7 +540,6 @@ namespace System.Data {
writer.WriteEndElement();
}
}
private void WriteStartElement( XmlWriter writer, XmlWriteMode mode, string nspc, string prefix, string name )
@@ -673,8 +586,11 @@ 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 );
@@ -700,8 +616,7 @@ 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, Thread.CurrentThread.CurrentCulture.Name);
writer.WriteAttributeString( XmlConstants.MsdataPrefix, XmlConstants.Locale, XmlConstants.MsdataNamespace, "en-us" );
//<xs:complexType>
writer.WriteStartElement( XmlConstants.SchemaPrefix,
@@ -750,7 +665,6 @@ namespace System.Data {
//</xs:element>
writer.WriteEndElement();
//</schema>
writer.WriteEndElement();
}
@@ -777,7 +691,7 @@ namespace System.Data {
//TODO - what about the simple content?
if( elements.Count == 0 )
{
{
}
else
{
@@ -794,33 +708,16 @@ 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() );
// Write SimpleType if column have MaxLength
if (col.MaxLength > -1) {
WriteTableSimpleType (writer, col);
}
writer.WriteAttributeString( XmlConstants.MsdataPrefix,
XmlConstants.Ordinal,
XmlConstants.MsdataNamespace,
col.Ordinal.ToString() );
//</xs:element>
writer.WriteEndElement();
}
@@ -850,31 +747,6 @@ 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
@@ -915,14 +787,10 @@ namespace System.Data {
}
}
[MonoTODO]
private string MapType( Type type )
{
string Result;
Result = "xs:string";
return Result;
//TODO -
return "xs:string";
}
#endregion //Private Xml Serialisation
+5 -73
View File
@@ -430,9 +430,8 @@ namespace System.Data {
[MonoTODO]
public virtual DataTable Clone()
{
DataTable Copy = new DataTable ();
CopyProperties (Copy);
return Copy;
//FIXME:
return this; //Don't know if this is correct
}
/// <summary>
@@ -442,7 +441,7 @@ namespace System.Data {
[MonoTODO]
public object Compute(string expression, string filter)
{
{
//FIXME: //Do a real compute
object obj = "a";
return obj;
@@ -454,49 +453,10 @@ namespace System.Data {
[MonoTODO]
public DataTable Copy()
{
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;
//FIXME: Do a real copy
return this;
}
[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
@@ -824,34 +784,6 @@ 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,7 +12,6 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Globalization;
namespace System.Data {
/// <summary>
@@ -24,6 +23,7 @@ namespace System.Data {
public class DataTableCollection : InternalDataCollectionBase
{
DataSet dataSet;
const string defaultTableName = "Table1";
#region Constructors
@@ -62,19 +62,13 @@ namespace System.Data {
public virtual DataTable Add ()
{
DataTable Table = new DataTable ();
Add (Table);
return Table;
return this.Add (defaultTableName);
}
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)
@@ -124,7 +118,6 @@ namespace System.Data {
public void Remove (DataTable table)
{
this.Remove (table.TableName);
OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, table));
}
public void Remove (string name)
@@ -139,39 +132,6 @@ 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,9 +33,6 @@ 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";
@@ -46,11 +43,7 @@ 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,12 +35,48 @@ 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:
@@ -62,6 +98,18 @@ 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
@@ -86,16 +134,15 @@ 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 ();
@@ -106,7 +153,7 @@ namespace System.Data {
if (reader.NodeType == XmlNodeType.Element) {
string dataColumnName = reader.LocalName;
if (NewTable)
if (addTable)
table.Columns.Add (dataColumnName);
// FIXME: exception?
@@ -125,6 +172,9 @@ namespace System.Data {
}
table.Rows.Add (row);
if (addTable)
DSet.Tables.Add (table);
}
}
}
@@ -12,8 +12,6 @@
//
// (C) 2002 Ville Palo
//
// TODO: Relations
//
using System;
using System.Data;
@@ -24,6 +22,10 @@ using System.Globalization;
namespace System.Data {
/*\
* There is so much TODO here that i dont bother to list them.
\*/
internal class XmlSchemaMapper
{
#region Fields
@@ -51,8 +53,9 @@ 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
@@ -86,6 +89,8 @@ namespace System.Data {
private void ReadXmlSchemaChoice (XmlSchemaChoice Choice)
{
//MaxOccurs
XmlSchemaObject SchemaObject;
foreach (XmlSchemaObject TempObject in Choice.Items) {
@@ -124,11 +129,9 @@ namespace System.Data {
DataTable TempTable = new DataTable (Element.Name);
DSet.Tables.Add (TempTable);
// If type is already defined in schema read it...
// FIXME: if this element comes before types
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=
@@ -169,12 +172,13 @@ namespace System.Data {
DataColumn Column = new DataColumn (Element.Name);
Table.Columns.Add (Column);
if (Element.UnhandledAttributes != null) {
if (Element.UnhandledAttributes == null)
return;
foreach (XmlAttribute Attr in Element.UnhandledAttributes) {
switch (Attr.LocalName) {
foreach (XmlAttribute Attr in Element.UnhandledAttributes) {
switch (Attr.LocalName) {
case "Caption":
Column.Caption = Attr.Value;
break;
@@ -183,10 +187,10 @@ namespace System.Data {
break;
case "type":
// FIXME:
break;
default:
break;
}
}
}
@@ -194,6 +198,7 @@ namespace System.Data {
// Handel rest of the parameters
//
// FIXME: Default columntype is string???
if (Column.DataType == null)
Column.DataType = Type.GetType ("System.String");
@@ -355,23 +360,8 @@ namespace System.Data {
{
XmlSchemaComplexType ComplexType = Type as XmlSchemaComplexType;
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);
}
if (ComplexType.Name != null && !TypeCollection.Contains (ComplexType.Name)) {
TypeCollection.Add (ComplexType.Name, ComplexType);
}
else {
XmlSchemaParticle Particle;
@@ -13,7 +13,6 @@
// Ville Palo <[email protected]>
//
// (c)copyright 2002 Daniel Morgan
// (c)copyright 2003 Ville Palo
//
// XmlDataDocument is included within the Mono Class Library.
//
@@ -25,7 +24,6 @@ using System.Text;
using System.Xml.XPath;
using System.Collections;
using System.Globalization;
using System.ComponentModel;
namespace System.Xml {
@@ -49,86 +47,21 @@ namespace System.Xml {
public XmlDataDocument() {
dataSet = new DataSet();
dataSet.Tables.CollectionChanged += new CollectionChangeEventHandler (OnDataTableChanged);
this.NodeChanged += new XmlNodeChangedEventHandler (OnNodeChanged);
this.NodeChanging += new XmlNodeChangedEventHandler (OnNodeChanging);
//this.NodeChanging += new XmlNodeChangedEventHandler (OnXmlDataColumnChanged);
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 (OnNodeChanging);
//this.NodeChanging += new XmlNodeChangedEventHandler (OnXmlDataColumnChanged);
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
@@ -144,6 +77,7 @@ namespace System.Xml {
}
public DataSet DataSet {
[MonoTODO]
get {
return dataSet;
}
@@ -151,19 +85,19 @@ namespace System.Xml {
// override inheritted method from XmlDocument
public override string InnerXml {
[MonoTODO("override???")]
[MonoTODO]
get {
return base.InnerXml;
throw new NotImplementedException();
}
[MonoTODO]
set {
base.InnerXml = value;
throw new NotImplementedException();
}
}
public override bool IsReadOnly {
[MonoTODO("override???")]
[MonoTODO]
get {
return isReadOnly;
}
@@ -172,35 +106,36 @@ namespace System.Xml {
// Item indexer
public override XmlElement this[string name] {
[MonoTODO("override???")]
[MonoTODO]
get {
return base [name];
throw new NotImplementedException();
}
}
// Item indexer
public override XmlElement this[string localname, string ns] {
[MonoTODO("override???")]
[MonoTODO]
get {
return base [localname, ns];
throw new NotImplementedException();
}
}
public override string LocalName {
[MonoTODO("override???")]
[MonoTODO]
get {
return base.LocalName;
throw new NotImplementedException();
}
}
public override string Name {
[MonoTODO("override??")]
[MonoTODO]
get {
return base.Name;
}
}
public override XmlDocument OwnerDocument {
[MonoTODO]
get {
return null;
}
@@ -213,23 +148,7 @@ namespace System.Xml {
[MonoTODO]
public override XmlNode CloneNode(bool deep)
{
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;
throw new NotImplementedException();
}
#region overloaded CreateElement methods
@@ -285,8 +204,10 @@ 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;
@@ -322,6 +243,7 @@ namespace System.Xml {
}
}
return row;
}
@@ -341,38 +263,46 @@ namespace System.Xml {
public override void Load(XmlReader reader) {
bool OldEC = DataSet.EnforceConstraints;
DataSet.EnforceConstraints = false;
// dont listen these events
RemoveXmlDocumentListeners ();
dataSet.Tables.CollectionChanged -= new CollectionChangeEventHandler (OnDataTableChanged);
DataTable dt = null;
// 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
if (DataSet.Tables.Contains (reader.LocalName)) {
for (int i = 0; i < DataSet.Tables.Count && dt == null; i++) {
dt = DataSet.Tables [reader.LocalName];
dt.ColumnChanged += new DataColumnChangeEventHandler (OnDataTableColumnChanged);
dt.RowDeleted += new DataRowChangeEventHandler (OnDataTableRowDeleted);
dt.RowChanged += new DataRowChangeEventHandler (OnDataTableRowChanged);
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);
}
}
else
continue;
// TODO: Findout what kind of exception
if (dt == null)
throw new Exception (); // there were no correct table
// Read rows to table
DataRow tempRow = dt.NewRow ();
@@ -400,11 +330,8 @@ 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
@@ -423,46 +350,35 @@ namespace System.Xml {
#region Protected Methods
//FIXME: when internal protected bug is fixed uncomment this
//FIXME: how do you handle this?
//[MonoTODO]
//protected internal override XPathNavigator CreateNavigator(XmlNode node) {
// throw new NotImplementedException();
//}
#endregion // Protected Methods
#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."));
[MonoTODO]
public new XPathNavigator CreateNavigator() {
throw new NotImplementedException();
}
#endregion // Protected Methods
#region DataSet event handlers
// 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.ParentNode.ParentNode);
DataRow row = GetRowFromElement ((XmlElement)args.Node);
if (row == null)
return;
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);
if (row [args.Node.Name].ToString () != args.Node.InnerText)
row [args.Node.Name] = args.Node.InnerText;
}
// Invoked when XmlNode is removed
@@ -472,24 +388,37 @@ 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 " +
@@ -500,7 +429,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;
@@ -524,13 +453,12 @@ 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 ()) {
if (dt.Columns.Contains (enumerator.Key.ToString ()))
row [enumerator.Key.ToString ()] = enumerator.Value.ToString ();
row [enumerator.Key.ToString ()] = enumerator.Value.ToString ();
}
dt.RowChanged -= new DataRowChangeEventHandler (OnDataTableRowChanged);
@@ -539,23 +467,7 @@ namespace System.Xml {
}
}
#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]
[MonoTODO]
private void OnDataTableColumnChanged(object sender,
DataColumnChangeEventArgs eventArgs)
{
@@ -631,15 +543,10 @@ 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++) {
@@ -647,6 +554,7 @@ namespace System.Xml {
rowElement = CreateElement (row.Table.Columns [i].ToString ());
rowElement.InnerText = (string)row [i];
element.AppendChild (rowElement);
}
AddXmlDocumentListeners ();
@@ -709,16 +617,12 @@ 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
}
-4
View File
@@ -1,7 +1,3 @@
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,7 +31,6 @@ 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,11 +1,3 @@
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
@@ -1,378 +0,0 @@
//
// 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]);
}
}
}
@@ -1,3 +0,0 @@
2003-01-13 Ville Palo <[email protected]>
* XmlDataDocumentTest.cs: Added more tests
@@ -10,10 +10,7 @@ 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
{
@@ -27,7 +24,6 @@ namespace MonoTests.System.Data.Xml
protected override void SetUp()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
}
public static ITest Suite {
@@ -36,178 +32,6 @@ 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()
{
@@ -296,7 +120,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);
@@ -494,6 +318,7 @@ 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);
}
@@ -519,7 +344,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);
@@ -711,7 +536,7 @@ namespace MonoTests.System.Data.Xml
substring = TextString.Substring (0, TextString.Length);
AssertEquals ("#G08", "</Root>", substring);
}
public void Test6 ()
@@ -734,12 +559,10 @@ 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);
@@ -765,7 +588,6 @@ namespace MonoTests.System.Data.Xml
substring = TextString.Substring (0, TextString.Length);
AssertEquals ("#H06", "</Root>", substring);
}
public void TestGetElementFromRow ()
@@ -1,5 +1,7 @@
<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"/>
@@ -22,6 +24,4 @@
</xsd:sequence>
</xsd:complexType>
<xsd:element name="bookstore" type="bookstoreType"/>
</xsd:schema>
</xsd:schema>
@@ -18,18 +18,6 @@ System.Data.SqlTypes/SqlDateTimeTest.cs
System.Data.SqlTypes/SqlGuidTest.cs
System.Data.SqlTypes/SqlDecimalTest.cs
System.Data.SqlTypes/SqlStringTest.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
System.Xml/AllTests.cs
AllTests.cs
-4
View File
@@ -1,7 +1,3 @@
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,18 +1,3 @@
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#";
private ArrayList Info;
private string id;
protected ArrayList Info;
protected string id;
public KeyInfo()
{
@@ -14,7 +14,7 @@ namespace System.Security.Cryptography.Xml {
public class KeyInfoName : KeyInfoClause {
private string Name;
protected string Name;
public KeyInfoName() {}
@@ -14,7 +14,7 @@ namespace System.Security.Cryptography.Xml {
public class KeyInfoNode : KeyInfoClause {
private XmlElement Node;
protected XmlElement Node;
public KeyInfoNode () {}
@@ -14,7 +14,7 @@ namespace System.Security.Cryptography.Xml {
public class KeyInfoRetrievalMethod : KeyInfoClause {
private string URI;
protected string URI;
public KeyInfoRetrievalMethod () {}
@@ -28,11 +28,11 @@ internal class IssuerSerial {
public class KeyInfoX509Data : KeyInfoClause {
private byte[] x509crl;
private ArrayList IssuerSerialList;
private ArrayList SubjectKeyIdList;
private ArrayList SubjectNameList;
private ArrayList X509CertificateList;
protected byte[] x509crl;
protected ArrayList IssuerSerialList;
protected ArrayList SubjectKeyIdList;
protected ArrayList SubjectNameList;
protected ArrayList X509CertificateList;
public KeyInfoX509Data ()
{
@@ -153,10 +153,10 @@ public class KeyInfoX509Data : KeyInfoClause {
return doc.DocumentElement;
}
public override void LoadXml (XmlElement element)
public override void LoadXml (XmlElement value)
{
if (element == null)
throw new ArgumentNullException ("element");
if (value == null)
throw new ArgumentNullException ();
IssuerSerialList.Clear ();
SubjectKeyIdList.Clear ();
@@ -165,10 +165,10 @@ public class KeyInfoX509Data : KeyInfoClause {
x509crl = null;
string ns = "http://www.w3.org/2000/09/xmldsig#";
if ((element.LocalName == "X509Data") && (element.NamespaceURI == ns)) {
if ((value.LocalName == "X509Data") && (value.NamespaceURI == ns)) {
XmlNodeList xnl = null;
// <X509IssuerSerial>
xnl = element.GetElementsByTagName ("X509IssuerSerial", ns);
xnl = value.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 = element.GetElementsByTagName ("X509SKI", ns);
xnl = value.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 = element.GetElementsByTagName ("X509SubjectName", ns);
xnl = value.GetElementsByTagName ("X509SubjectName", ns);
if (xnl != null) {
for (int i=0; i < xnl.Count; i++) {
AddSubjectName (xnl[i].InnerXml);
}
}
// <X509Certificate>
xnl = element.GetElementsByTagName ("X509Certificate", ns);
xnl = value.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 = element.GetElementsByTagName ("X509CRL", ns);
xnl = value.GetElementsByTagName ("X509CRL", ns);
if ((xnl != null) && (xnl.Count > 0)) {
x509crl = Convert.FromBase64String (xnl[0].InnerXml);
}
}
else
throw new CryptographicException ("element");
throw new CryptographicException ("value");
}
}
@@ -14,7 +14,9 @@ namespace System.Security.Cryptography.Xml {
public abstract class Transform {
private string algo;
protected string algo;
protected Type[] input;
protected Type[] output;
public Transform () {}
@@ -17,13 +17,11 @@ 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 ()
{
Algorithm = "http://www.w3.org/2000/09/xmldsig#base64";
algo = "http://www.w3.org/2000/09/xmldsig#base64";
}
public override Type[] InputTypes {
@@ -9,21 +9,16 @@
//
using System.IO;
using System.Text;
using System.Xml;
namespace System.Security.Cryptography.Xml {
public class XmlDsigC14NTransform : Transform {
private Type[] input;
private Type[] output;
private bool comments;
private Stream s;
protected bool comments;
public XmlDsigC14NTransform ()
{
Algorithm = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
comments = false;
}
@@ -67,7 +62,8 @@ public class XmlDsigC14NTransform : Transform {
public override object GetOutput ()
{
return (object) s;
// return (object) new Stream ();
return null;
}
public override object GetOutput (Type type)
@@ -79,31 +75,12 @@ public class XmlDsigC14NTransform : Transform {
public override void LoadInnerXml (XmlNodeList nodeList)
{
// documented as not changing the state of the transform
// NO CHANGE
}
public override void LoadInput (object obj)
{
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
// if (type.Equals (Stream.GetType ())
}
}
@@ -15,9 +15,7 @@ namespace System.Security.Cryptography.Xml {
public class XmlDsigEnvelopedSignatureTransform : Transform {
private Type[] input;
private Type[] output;
private bool comments;
protected bool comments;
public XmlDsigEnvelopedSignatureTransform ()
{
@@ -20,8 +20,6 @@ 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,8 +18,6 @@ namespace System.Security.Cryptography.Xml {
public class XmlDsigXsltTransform : Transform {
private Type[] input;
private Type[] output;
private bool comments;
private XmlNodeList xnl;
private CryptoStream cs;
@@ -29,7 +27,7 @@ public class XmlDsigXsltTransform : Transform {
public XmlDsigXsltTransform (bool includeComments)
{
comments = includeComments;
Algorithm = "http://www.w3.org/TR/1999/REC-xslt-19991116";
algo = "http://www.w3.org/TR/1999/REC-xslt-19991116";
}
public override Type[] InputTypes {
@@ -2,26 +2,36 @@
<!-- NAnt build file for System.Security.dll -->
<project name="System.Security" default="build">
<project name="System.Data" 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:..\lib\System.XML.dll"/>
<arg value="/r: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"/>
<nant basedir="Test" target="clean"/>
<delete file="Test/System.Security.dll" failonerror="false"/>
</target>
</project>
+3 -2
View File
@@ -1,5 +1,5 @@
//
// MonoTests.System.Security.AllTests.cs
// TestSuite.System.Security.AllTests.cs
//
// Author:
// Sebastien Pouliot ([email protected])
@@ -8,9 +8,10 @@
//
using System;
using System.Security.Cryptography;
using NUnit.Framework;
namespace MonoTests.System.Security {
namespace MonoTests.System.Security{
public class AllTests : TestCase {
-5
View File
@@ -1,8 +1,3 @@
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,18 +13,21 @@
<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.XML.dll"/>
<includes name="..\class\lib\System.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">
@@ -32,8 +35,7 @@
</target>
<target name="clean">
<delete file="System.Security_test.dll" failonerror="false"/>
<delete file="System.Security.dll" failonerror="false"/>
<delete file="System.XML.dll" failonerror="false"/>
<delete file="System.Security_test.dll" failonerror="false"/>
</target>
</project>
-4
View File
@@ -1,8 +1,4 @@
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,7 +30,6 @@
<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 : 2003 with Gaurav Vaish, and with
* Copyright : 2002 with Gaurav Vaish, and with
* Ximian Inc
*/
Loaded 100 of 377 files, more files were not shown because too many files have changed in this diff. Show more