mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 01:41:17 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f0db6b551 |
No files matched your search
@@ -1,146 +1,3 @@
|
||||
2003-02-17 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/provider-factory: add new web page
|
||||
about Mono.Data's ProviderFactory
|
||||
|
||||
* doc/web/commands
|
||||
* doc/web/makefile: add provider-factory web page to build
|
||||
|
||||
* doc/ado-net
|
||||
* doc/ibmdb2
|
||||
* doc/postgresql
|
||||
* doc/sqlclient
|
||||
* doc/tdsclient
|
||||
* doc/sybase
|
||||
* doc/mysql
|
||||
* doc/firebird
|
||||
* doc/oracle
|
||||
* doc/oledb
|
||||
* doc/odbc
|
||||
* doc/sqlite: updated web pages
|
||||
|
||||
2003-02-16 Martin Baulig <[email protected]>
|
||||
|
||||
* doc/jit-debug-sample
|
||||
* doc/jit-debug-sample2: Removed.
|
||||
|
||||
* doc/jit-debug: Updated.
|
||||
|
||||
2003-02-13 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/screenshots
|
||||
* doc/ado-net
|
||||
* doc/oracle
|
||||
* doc/gtk-sharp: update web pages
|
||||
|
||||
2003-02-13 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* data/machine.config: added sample globalization section.
|
||||
|
||||
2003-02-12 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* data/machine.config: added UrlAuthorizationModule and
|
||||
AuthenticationConfigHandler.
|
||||
|
||||
2003-02-11 Tim Coleman <[email protected]>
|
||||
* data/config.in: Add mapping for Oracle call interface
|
||||
(OCI) native libraries.
|
||||
|
||||
2003-02-04 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* configure.in: added check for sys/un.h.
|
||||
|
||||
2003-01-29 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/postgresql
|
||||
* doc/mysql
|
||||
* doc/ado-net: updates to web pages
|
||||
|
||||
* man/sqlsharp.1: update to man page
|
||||
|
||||
2003-01-28 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* configure.in: added WIN32_THREADS flag when building under windows.
|
||||
It seems that the header files of the gc do not always define it when
|
||||
GC_WIN32_THREADS is defined.
|
||||
|
||||
2003-01-26 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/index
|
||||
* doc/ado-net
|
||||
* doc/firebird
|
||||
* doc/ibmdb2
|
||||
* doc/mysql
|
||||
* doc/odbc
|
||||
* doc/oledb
|
||||
* doc/oracle
|
||||
* doc/postgresql
|
||||
* doc/sqlclient
|
||||
* doc/sqlite
|
||||
* doc/sybase
|
||||
* doc/tdsclient: corrections
|
||||
|
||||
2003-01-26 Duncan Mak <[email protected]>
|
||||
|
||||
* doc/jit-debug: Update the links. Thanks for Andy Oliver for the report.
|
||||
|
||||
2003-01-22 Martin Baulig <[email protected]>
|
||||
|
||||
* configure.in: Set version number to 0.19.1.
|
||||
|
||||
Heads up: I'm going to commit some changes to the debugger
|
||||
which'll require you to use this new runtime, so if you update the
|
||||
debugger from CVS, you also need this new runtime.
|
||||
|
||||
2003-01-20 Duncan Mak <[email protected]>
|
||||
|
||||
* configure.in: Bump the release number to 0.19.
|
||||
|
||||
2003-01-19 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/ibmdb2: added file which is new web page
|
||||
about IBM DB2 data provider at Mono.Data.DB2Client
|
||||
|
||||
* makefile
|
||||
* commands: added ibmdb2 web page to go-mono web site
|
||||
|
||||
* doc/ado-net: added a couple more developers email, plus made the
|
||||
email spam resistant, added Mono's DB2 data provider to list,
|
||||
added more info about the ProviderFactory and retrieving data using
|
||||
ADO.NET from ASP.NET, add notes about testing, misc cleanup
|
||||
|
||||
* doc/mysql
|
||||
* doc/postgresql
|
||||
* doc/sqlclient
|
||||
* doc/oracle
|
||||
* doc/tdsclient
|
||||
* doc/firebird
|
||||
* doc/oledb
|
||||
* doc/odbc
|
||||
* doc/sybase
|
||||
* doc/sqlite: added testing notes and C# examples
|
||||
|
||||
* doc/gtk-sharp: added links for GTK# for Windows
|
||||
|
||||
* man/sqlsharp.1: added providers Npgsql and MySQLNet
|
||||
|
||||
2003-01-17 Duncan Mak <[email protected]>
|
||||
|
||||
* runtime/Makefile.am: Add the new Mono.Data.DB2Client.dll.
|
||||
|
||||
2003-01-16 Martin Baulig <[email protected]>
|
||||
|
||||
* configure.in (GTHREAD_LIBS, GTHREAD_CFLAGS): Removed the gthread
|
||||
check again, we're now using the mono/io-layer for this.
|
||||
|
||||
Wed Jan 15 16:20:54 CET 2003 Paolo Molaro <[email protected]>
|
||||
|
||||
* configure.in: allow MacOSX (from various people).
|
||||
|
||||
2003-01-14 Martin Baulig <[email protected]>
|
||||
|
||||
* configure.in (GTHREAD_LIBS, GTHREAD_CFLAGS): Added check for gthread.
|
||||
|
||||
2002-12-27 Jeroen Janssen <[email protected]>
|
||||
* fixed url for System.Windows.Forms in the class status
|
||||
|
||||
|
||||
@@ -1,534 +1,3 @@
|
||||
Hello everyone!
|
||||
|
||||
The Mono Team introduces the best Mono release so far we have
|
||||
done. Thanks to everyone who contributed fixes, code, ideas, and bug
|
||||
reports.
|
||||
|
||||
Mono 0.20 has been released, it is available at the usual location:
|
||||
|
||||
http://www.go-mono.com/download.html
|
||||
|
||||
This is a truly heroic release of Mono. Major architectural
|
||||
chunks that were missing, or were miss-implemented have been fixed in
|
||||
this release, and we are very proud of it. Please see the list of
|
||||
features, because there is no short way of introducing just how good
|
||||
this release is. A big thanks goes to Piers for setting up a
|
||||
Tinderbox that monitors problems with the Mono CVS repository.
|
||||
|
||||
We released packages for SuSE 8.0, Mandrake 8.2, and various
|
||||
Red Hat releases. It is also available from Red Carpet on the Mono
|
||||
channel.
|
||||
|
||||
Source code for Mono, MCS, the Mono Debugger, XSP is available as
|
||||
well from that web page. The sources are:
|
||||
|
||||
MCS package (Class Libraries, C# and VB.NET compiler and managed tools):
|
||||
|
||||
http://www.go-mono.com/archive/mcs-0.20.tar.gz
|
||||
|
||||
Mono package (Runtime engine, JIT compiler):
|
||||
|
||||
http://www.go-mono.com/archive/mono-0.20.tar.gz
|
||||
|
||||
XSP package (XSP test web server for ASP.NET webforms):
|
||||
|
||||
http://www.go-mono.com/archive/xsp-0.3.tar.gz
|
||||
|
||||
This release is brought to you by: Alvaro del Castillo, Alan Tam,
|
||||
Alp Toker, Alejandro Sánchez, Alexandre Pigolkin, Atsushi Enomoto,
|
||||
Brian Ritchie, Christopher Bockner, Daniel Lopez, Daniel Morgan,
|
||||
Dennis Hayes, Dick Porter, Dietmar Maurer, Duncan Mak, Gaurav Vaish,
|
||||
Gonzalo Paniagua, Jackson Harper, Jaime Anguiano, Jeff Stedfast,
|
||||
Johannes Roith, John Sohn, Jonathan Pryor, "Lee Mallabone, "Lluis
|
||||
Sanchez, "Marco Ridoni, Mark Crichton, Martin Baulig, Martin Willemoes
|
||||
Hansen, Miguel de Icaza, Mike Kestner, Nick Drochak, Paolo Molaro,
|
||||
Patrik Torstensson, Pedro Martinez, Per Arneng, Peter Williams, Petr
|
||||
Danecek, Piers Haken, Radek Doulik, Rafael Teixeira, Rodrigo Moya,
|
||||
Sebastien Pouliot, Tim Coleman, Ville Palo, and Zoltan Varga.
|
||||
|
||||
They commited 1810 changes to CVS patches in the past 33 days.
|
||||
|
||||
* New in this release
|
||||
|
||||
* Zoltan and IKVM
|
||||
|
||||
Zoltan's patches to run Jeroen's IKVM (the Java VM that
|
||||
translates JVM bytecodes into .NET bytecodes) are in.
|
||||
|
||||
* Remoting.
|
||||
|
||||
The remoting team's patches that were held off on the previous
|
||||
release are here. Lluis and Patrik have done a fantastic job
|
||||
in getting remoting to work. Many low-level runtime engine
|
||||
changes, and plenty of work on the class-library stuff.
|
||||
|
||||
Lluis has posted a couple of sample applications to the
|
||||
mailing list, you can try those out.
|
||||
|
||||
The new release includes a working BinaryFormatter and
|
||||
BinaryFormatterSink. It means that together with TcpChannel
|
||||
it is possible to make remote calls with any type of
|
||||
parameters and return values, including value types,
|
||||
MarshalByRefObject types (that are properly
|
||||
marshalled/unmarshalled), delegates, enums, etc.
|
||||
|
||||
RemotingConfiguration is partially implemented. It cannot read
|
||||
from config files, but manual configuration using the api is
|
||||
fully working.
|
||||
|
||||
Implemented full support for client activated types and for
|
||||
well known objects (both singleton and single call).
|
||||
|
||||
Lease manager fully working (it manages the lifetime of server
|
||||
objects).
|
||||
|
||||
Implemented interception of the new operator, so it is
|
||||
possible to create a remote object using "new", if the type is
|
||||
properly registered in RemotingConfiguration.
|
||||
|
||||
In Lluis' words: `Basically, 0.20 will have almost all needed
|
||||
for a distributed application with Remoting'
|
||||
|
||||
* New threading semantics, IO-layer
|
||||
|
||||
Dick Porter in a couple of weeks has heroically redone much of
|
||||
the threading support to match the .NET behavior (details are
|
||||
on the .NET threading book as posted on the Mono site).
|
||||
|
||||
He also did a lot of bug fixes in the IO/threading space. The
|
||||
threading implementation now contains a new and faster Monitor
|
||||
implementation, as well as a correct Pulse()/Wait()
|
||||
implementation.
|
||||
|
||||
GC thread finalization has been re-enabled. This means that
|
||||
finalizers will be ran on a separate thread, as done in the
|
||||
Microsoft.NET Framework. This might expose some bugs on
|
||||
existing finalizer code.
|
||||
|
||||
* Moved to NUnit2
|
||||
|
||||
Nick and Gonzalo helped us move to the new NUnit2 platform for
|
||||
all of our tests. A big applause goes to them.
|
||||
|
||||
* Cross Appdomain invocations work now.
|
||||
|
||||
ASP.NET and NUnit2 both used cross appdomain invocations, we
|
||||
have fixed a number of problems, and they are now functional.
|
||||
|
||||
The AppDomain fixes and the Remoting fixes have allowed us to
|
||||
remove a number of hacks in the ASP.NET implementation that
|
||||
were previously there.
|
||||
|
||||
Implemented CrossAppDomainChannel, for calls between domains.
|
||||
|
||||
* C# Compiler and Debugging.
|
||||
|
||||
When generating debugging information in the compiler (with
|
||||
-debug, -g or -debug+) the compiler will embed the debugging
|
||||
information into the resulting executable instead of
|
||||
generating a separate file. Very nice.
|
||||
|
||||
Generating debugging information has also improved vastly
|
||||
performance-wise, and now it is possible to always use
|
||||
debugging builds for software development.
|
||||
|
||||
A number of bugs were fixed on the compiler as well and
|
||||
by using the Mono profiler we have reduced the memory
|
||||
consumption and accelerated the compiler.
|
||||
|
||||
Thanks to Jackson, Martin, Paolo and for helping here.
|
||||
|
||||
* VB.NET Compiler.
|
||||
|
||||
Plenty of new features are included in the compiler in our
|
||||
path to conformance. See <FIXME:get-url-for-posting> for
|
||||
details on the status of the compiler, and the pieces missing.
|
||||
|
||||
* ILasm and Mono.PEToolkit.
|
||||
|
||||
Work on the IL assembler has resumed, but it is not yet ready
|
||||
for production use. The Mono IL Assembler uses the
|
||||
Mono.PEToolkit library done by Sergey and Jackson to
|
||||
manipulate CIL image files.
|
||||
|
||||
* Cryptographic work.
|
||||
|
||||
Sebastien has provided a cert2spc and secutil tools for
|
||||
certificate management. This is the first release that ships
|
||||
an assembly for System.Security
|
||||
|
||||
Also a new internal assembly used only on Windows allows Mono
|
||||
users to use the unmanaged crypto providers.
|
||||
|
||||
* System.XML
|
||||
|
||||
Atsushi has continued to improve the work on our XML
|
||||
implementation: fixing bugs and more closely matching the
|
||||
Microsoft implementation.
|
||||
|
||||
* More PowerPC/Alpha support.
|
||||
|
||||
Taylor Christopher has contributed more code generation macros
|
||||
for PPC and Laramie Leavitt for Alpha.
|
||||
|
||||
* System.XML.Xsl
|
||||
|
||||
Gonzalo continued the implementation of our XSLT transformation
|
||||
API (custom .NET functions are still missing though). It no
|
||||
longer uses temporary files to apply transformations. Thanks
|
||||
to an idea from Zdravko Tashev. Xslt Web controls work as
|
||||
part of this fix.
|
||||
|
||||
* ASP.NET
|
||||
|
||||
Gonzalo has cleaned up a lot the code base, and now our test
|
||||
server supports a --root and --virtual command line options
|
||||
for better control.
|
||||
|
||||
Also, now we generate a much nicer error page on errors. We
|
||||
are looking for volunteers to improve the default look of this
|
||||
page.
|
||||
|
||||
Authentication is now supported
|
||||
|
||||
* Mobile Controls.
|
||||
|
||||
Gaurav Vaish continues on his quest to complete the
|
||||
implementation of the Mobile controls. These controls are
|
||||
required to run a stock IBuySpy application.
|
||||
|
||||
* Class Libraries:
|
||||
|
||||
New Mono.Posix class library that contains classes for working
|
||||
on a Posix systems. Things like Unix domain sockets are here.
|
||||
|
||||
* System.Windows.Forms
|
||||
|
||||
Alexandre Pigolkine continues to contribute more code to our
|
||||
Windows.Forms implementation. Currently it only runs on
|
||||
Windows (or in Linux without GC enabled, due to the
|
||||
pthread/Wine threading library mismatch. This is being
|
||||
actively addressed as part of the Wine work due to the
|
||||
movement to the new thread implementation available in RH 8.1).
|
||||
|
||||
* Database providers
|
||||
|
||||
Christopher Bockner has updated his DB2 database provider (now
|
||||
with prepared statement functionality) and Tim Coleman has
|
||||
continued work on the Oracle database provider (welcome back
|
||||
Tim!)
|
||||
|
||||
* Database code.
|
||||
|
||||
Dan Morgan continues to develop core components in System.Data
|
||||
(and now we welcome Alan Tam to the System.Data core hackers)
|
||||
|
||||
The SQL# tool now supports MySQLNet, Npgsql, DB2Client, and
|
||||
Oracle clients.
|
||||
|
||||
* Runtime
|
||||
|
||||
mono --profile now performs memory allocation profiling too.
|
||||
|
||||
* Runtime fixes.
|
||||
|
||||
We now support multi-module with external file reference
|
||||
assemblies.
|
||||
|
||||
The above in English means that we can now run Eiffel.NET code
|
||||
in Mono.
|
||||
|
||||
* Monograph:
|
||||
|
||||
More statistics supported now.
|
||||
|
||||
* System.Web.Mail
|
||||
|
||||
Per has contributed the code for this namespace.
|
||||
|
||||
* Bugs
|
||||
|
||||
Plenty of bugs were closed.
|
||||
-------------------------------------------------------------------------
|
||||
Hello everyone!
|
||||
|
||||
We have made a new release of Mono available. Despite the fact
|
||||
that we just did Mono 0.18, this release is packed with new features.
|
||||
|
||||
* Availability.
|
||||
|
||||
Mono 0.19 is available in package format from:
|
||||
|
||||
http://www.go-mono.com/download.html
|
||||
|
||||
We released packages for SuSE 8.0, Mandrake 8.2, Debian and various
|
||||
Red Hat releases. It is also available from Red Carpet on the Mono
|
||||
channel.
|
||||
|
||||
Source code for Mono, MCS, the Mono Debugger, XSP is available as
|
||||
well from that web page.
|
||||
|
||||
* New in this release
|
||||
|
||||
* Remoting news:
|
||||
|
||||
Lluis has implemented and documented the Binary formatter
|
||||
Woohoo! He has done a lot of work as well to support
|
||||
remoting.
|
||||
|
||||
Patrik has also been working heavily on fixing a
|
||||
number of remoting related bugs and missing features.
|
||||
|
||||
Ajay also implemented 1-d array serialization in System.Xml
|
||||
|
||||
* New database provider: IBM DB2
|
||||
|
||||
Christopher Bockner has contributed a DB2 data
|
||||
provider for System.Data. We have a very complete
|
||||
range of data providers.
|
||||
|
||||
* System.Web.Mobile
|
||||
|
||||
Gaurav has started work on this assembly, this will
|
||||
allow us to run the unmodified reference ASP.NET
|
||||
applications that were designed to support Mobile
|
||||
browsing.
|
||||
|
||||
* System.Data and System.XML:
|
||||
|
||||
More implementation work on XmlDataDocument from Ville
|
||||
and plenty of fixes from Atsushi.
|
||||
|
||||
* MacOS patches:
|
||||
|
||||
Paolo integrated John Duncan's and Benjamin Reed
|
||||
patches to make Mono run on MacOS X out of the box.
|
||||
|
||||
* IsolatedStorage
|
||||
|
||||
The initial implementation of it was done by Jonathan
|
||||
Pryor and included in this release.
|
||||
|
||||
* Compilers:
|
||||
|
||||
More work on the Mono Visual Basic compiler (it is now
|
||||
included in the packages).
|
||||
|
||||
Plenty of bug fixes from Jackson, Miguel to the C#
|
||||
compiler.
|
||||
|
||||
Patches from Francesco and Daniel to the VB.NET
|
||||
support runtime.
|
||||
|
||||
* Debugger support
|
||||
|
||||
Plenty of updates to run the new Mono Debugger from Martin.
|
||||
|
||||
* Main missing bits:
|
||||
|
||||
Some of everyone's favorite patches or code chunks have not yet
|
||||
been integrated, hopefully Mono 0.20 will have them:
|
||||
|
||||
* Zoltan's patch to run IKVM is not yet on this release
|
||||
|
||||
* Some parts of Patrik's remoting code did not make it to the
|
||||
release either.
|
||||
|
||||
* Reggie's MySQL native provider is also missing.
|
||||
|
||||
Enjoy!
|
||||
Miguel.
|
||||
-------------------------------------------------------------------------
|
||||
Hello everyone!
|
||||
|
||||
We have made a new release of Mono available. Despite the fact
|
||||
that we just did Mono 0.18, this release is packed with new features.
|
||||
|
||||
* Availability.
|
||||
|
||||
Mono 0.19 is available in package format from:
|
||||
|
||||
http://www.go-mono.com/download.html
|
||||
|
||||
We released packages for SuSE 8.0, Mandrake 8.2, Debian and various
|
||||
Red Hat releases. It is also available from Red Carpet on the Mono
|
||||
channel.
|
||||
|
||||
Source code for Mono, MCS, the Mono Debugger, XSP is available as
|
||||
well from that web page.
|
||||
|
||||
* New in this release
|
||||
|
||||
* Remoting news:
|
||||
|
||||
Lluis has implemented and documented the Binary formatter
|
||||
Woohoo! He has done a lot of work as well to support
|
||||
remoting.
|
||||
|
||||
Patrik has also been working heavily on fixing a
|
||||
number of remoting related bugs and missing features.
|
||||
|
||||
Ajay also implemented 1-d array serialization in System.Xml
|
||||
|
||||
* New database provider: IBM DB2
|
||||
|
||||
Christopher Bockner has contributed a DB2 data
|
||||
provider for System.Data. We have a very complete
|
||||
range of data providers.
|
||||
|
||||
* System.Web.Mobile
|
||||
|
||||
Gaurav has started work on this assembly, this will
|
||||
allow us to run the unmodified reference ASP.NET
|
||||
applications that were designed to support Mobile
|
||||
browsing.
|
||||
|
||||
* System.Data and System.XML:
|
||||
|
||||
More implementation work on XmlDataDocument from Ville
|
||||
and plenty of fixes from Atsushi.
|
||||
|
||||
* MacOS patches:
|
||||
|
||||
Paolo integrated John Duncan's and Benjamin Reed
|
||||
patches to make Mono run on MacOS X out of the box.
|
||||
|
||||
* IsolatedStorage
|
||||
|
||||
The initial implementation of it was done by Jonathan
|
||||
Pryor and included in this release.
|
||||
|
||||
* Compilers:
|
||||
|
||||
More work on the Mono Visual Basic compiler (it is now
|
||||
included in the packages).
|
||||
|
||||
Plenty of bug fixes from Jackson, Miguel to the C#
|
||||
compiler.
|
||||
|
||||
Patches from Francesco and Daniel to the VB.NET
|
||||
support runtime.
|
||||
|
||||
* Debugger support
|
||||
|
||||
Plenty of updates to run the new Mono Debugger from Martin.
|
||||
|
||||
* Main missing bits:
|
||||
|
||||
Some of everyone's favorite patches or code chunks have not yet
|
||||
been integrated, hopefully Mono 0.20 will have them:
|
||||
|
||||
* Zoltan's patch to run IKVM is not yet on this release
|
||||
|
||||
* Some parts of Patrik's remoting code did not make it to the
|
||||
release either.
|
||||
|
||||
* Reggie's MySQL native provider is also missing.
|
||||
|
||||
Enjoy!
|
||||
Miguel.
|
||||
------------------------------------------------------------------------------
|
||||
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.
|
||||
@@ -637,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:
|
||||
|
||||
|
||||
+4
-20
@@ -1,7 +1,7 @@
|
||||
AC_INIT(README)
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono, 0.21)
|
||||
AM_INIT_AUTOMAKE(mono, 0.17)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
#
|
||||
@@ -9,9 +9,7 @@ AM_MAINTAINER_MODE
|
||||
# compiling code that will embed Mono
|
||||
#
|
||||
libmono_cflags=""
|
||||
libmono_ldflags=""
|
||||
AC_SUBST(libmono_cflags)
|
||||
AC_SUBST(libmono_ldflags)
|
||||
|
||||
# Thread configuration inspired by sleepycat's db
|
||||
AC_MSG_CHECKING([host platform characteristics])
|
||||
@@ -21,7 +19,7 @@ case "$host" in
|
||||
AC_DEFINE(PLATFORM_WIN32)
|
||||
CC="gcc -mno-cygwin"
|
||||
HOST_CC="gcc"
|
||||
CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS -DWIN32_THREADS"
|
||||
CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS"
|
||||
libdl=
|
||||
;;
|
||||
*-*-*bsd*)
|
||||
@@ -29,7 +27,6 @@ case "$host" in
|
||||
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
|
||||
libmono_cflags="-D_THREAD_SAFE"
|
||||
LDFLAGS="$LDFLAGS -pthread"
|
||||
libmono_ldflags="-pthread"
|
||||
AC_DEFINE(NEED_LINK_UNLINK)
|
||||
AC_DEFINE(PTHREAD_POINTER_ID)
|
||||
libdl=
|
||||
@@ -38,7 +35,6 @@ case "$host" in
|
||||
platform_win32=no
|
||||
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -DMONO_USE_EXC_TABLES -D_GNU_SOURCE -D_REENTRANT -fexceptions"
|
||||
libmono_cflags="-DMONO_USE_EXC_TABLES -fexceptions -D_REENTRANT"
|
||||
libmono_ldflags="-lpthread"
|
||||
libdl="-ldl"
|
||||
;;
|
||||
*-*-solaris*)
|
||||
@@ -47,16 +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"
|
||||
libmono_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
|
||||
@@ -95,7 +81,7 @@ AC_HEADER_STDC
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h)
|
||||
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h)
|
||||
|
||||
# for mono/metadata/debug-symfile.c
|
||||
AC_CHECK_HEADERS(elf.h)
|
||||
@@ -501,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
|
||||
@@ -531,7 +517,6 @@ AC_SUBST(LIBC)
|
||||
AC_SUBST(arch_target)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(CPPFLAGS)
|
||||
AC_SUBST(LDFLAGS)
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
@@ -550,7 +535,6 @@ mono/arch/ppc/Makefile
|
||||
mono/arch/sparc/Makefile
|
||||
mono/arch/s390/Makefile
|
||||
mono/arch/arm/Makefile
|
||||
mono/arch/alpha/Makefile
|
||||
mono/interpreter/Makefile
|
||||
mono/tests/Makefile
|
||||
mono/benchmark/Makefile
|
||||
|
||||
+1
-3
@@ -9,8 +9,6 @@
|
||||
<dllmap dll="libpango-1.0-0.dll" target="libpango-1.0.so" />
|
||||
<dllmap dll="libatk-1.0-0.dll" target="libatk-1.0.so" />
|
||||
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.so" />
|
||||
<dllmap dll="libgdk_pixbuf-2.0-0.dll" target="libgdk_pixbuf-2.0.so" />
|
||||
<dllmap dll="libgdk_pixbuf-2.0-0.dll" target="libgdk-pixbuf-2.0.so" />
|
||||
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so" />
|
||||
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so" />
|
||||
<dllmap dll="oci" target="clntsh" />
|
||||
</configuration>
|
||||
+11
-27
@@ -7,32 +7,23 @@
|
||||
|
||||
<section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System" />
|
||||
<sectionGroup name="system.web">
|
||||
<section name="httpHandlers"
|
||||
type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web" />
|
||||
<section name="httpModules"
|
||||
type="System.Web.Configuration.HttpModulesConfigurationHandler, System.Web" />
|
||||
<section name="machineKey"
|
||||
type="System.Web.Configuration.MachineKeyConfigHandler, System.Web" />
|
||||
<section name="authentication"
|
||||
type="System.Web.Configuration.AuthenticationConfigHandler, System.Web" />
|
||||
<section name="authorization"
|
||||
type="System.Web.Configuration.AuthorizationConfigHandler, System.Web" />
|
||||
<section name="globalization"
|
||||
type="System.Web.Configuration.GlobalizationConfigurationHandler, System.Web" />
|
||||
<section name="httpHandlers" type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web" />
|
||||
<section name="httpModules" type="System.Web.Configuration.HttpModulesConfigurationHandler, System.Web" />
|
||||
<section name="machineKey" type="System.Web.Configuration.MachineKeyConfigHandler, System.Web" />
|
||||
<section name="authentication" type="System.Web.Configuration.AuthenticationConfigHandler, System.Web" />
|
||||
</sectionGroup>
|
||||
</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="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule, 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="/">
|
||||
@@ -42,13 +33,6 @@
|
||||
</forms>
|
||||
</authentication>
|
||||
<machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
|
||||
<!-- Sample globalization settings
|
||||
<globalization requestEncoding="iso-8859-1"
|
||||
responseEncoding="iso-8859-1"
|
||||
fileEncoding="iso-8859-1"
|
||||
culture="en-US"
|
||||
uiculture="en-US" />
|
||||
-->
|
||||
</system.web>
|
||||
|
||||
<appSettings>
|
||||
|
||||
-30
@@ -15,33 +15,3 @@ To publish changes:
|
||||
|
||||
cd web
|
||||
make push
|
||||
|
||||
############## Samples
|
||||
|
||||
|
||||
If you want to add a new item in the left menu
|
||||
you have to edit mono/doc/web/commands and add
|
||||
the entry there.
|
||||
|
||||
For new files you can add something as:
|
||||
level,entry,path_to_the_file,file.src
|
||||
|
||||
ex: 1,COBOL#,cobol.html,cobol.src
|
||||
|
||||
If you just want to add a link to the menu:
|
||||
1,MyEntry,URL
|
||||
|
||||
ex: 1,About Linux,http://www.linux.org
|
||||
|
||||
To test the results under Linux:
|
||||
1. Edit mono/doc/web/makefile
|
||||
|
||||
Delete all the references to class status
|
||||
and the deploy/index.rss as well as the
|
||||
mono.exe commands.
|
||||
|
||||
2. make
|
||||
3. Open your browser and point to the
|
||||
file:///(YOUR PATH HERE)mono/doc/web/deploy/index.html
|
||||
|
||||
|
||||
+105
-355
@@ -1,235 +1,81 @@
|
||||
* ADO.NET
|
||||
|
||||
<p>Mono's ADO.NET Developers:
|
||||
|
||||
<table border=1>
|
||||
|
||||
<tr>
|
||||
<td><b>Developer</b></td>
|
||||
<td><b>Email</b></td>
|
||||
<td><b>Contribution</b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Rodrigo Moya</td>
|
||||
<td>rodrigo -AT-<br> ximian.comNOSPAM</td>
|
||||
<td>ADO.NET coordinator,<br> OLE DB provider,<br> and tests</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Daniel Morgan</td>
|
||||
<td>danmorg -AT-<br> sc.rr.comNOSPAM</td>
|
||||
<td>MySQL, PostgreSQL, <br>Oracle providers,<br> and tests</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Tim Coleman</td>
|
||||
<td>tim -AT- <br>timcoleman.comNOSPAM</td>
|
||||
<td>Microsoft SQL Server, <br>Sybase, <br>TDS providers,<br> Oracle,
|
||||
<br>and tests.<br>
|
||||
He has
|
||||
contributed <br>to other parts <br>of Mono too, <br>such as,
|
||||
<br>EnterpriseServices,
|
||||
XML, <br>and WebServices.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Brian Ritchie</td>
|
||||
<td>brianlritchie -AT-<br> hotmail.comNOSPAM</td>
|
||||
<td>ODBC provider <br>and the ProviderFactory <br>in Mono.Data</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Vladimir Vukicevic</td>
|
||||
<td>vladimir -AT-<br> pobox.comNOSPAM</td>
|
||||
<td>SQL Lite provider. <br> He has contributed to GTK# <br>and mPhoto too.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Christopher Bockner</td>
|
||||
<td>cleared -AT-<br> rogers.comNOSPAM</td>
|
||||
<td>IBM DB2 Universal <br>Database provider</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Ville Palo</td>
|
||||
<td>vi64pa -AT-<br> koti.soon.fiNOSPAM</td>
|
||||
<td>XML stuff <br>in System.Data <br>including DataSet <br>
|
||||
and XmlDataDocument, <br>and tests</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Gonzalo Paniagua Javier</td>
|
||||
<td>gonzalo -AT-<br> ximian.comNOSPAM</td>
|
||||
<td>Integration between <br>System.Web and <br>System.Data</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Gaurav Vaish</td>
|
||||
<td>gvaish -AT-<br> iitk.ac.inNOSPAM</td>
|
||||
<td>Web controls</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Phillip Jerkins</td>
|
||||
<td>Phillip.Jerkins -AT-<br> morgankeegan.comNOSPAM</td>
|
||||
<td>Named Instance support <br>in System.Data.SqlClient</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
** Bugs and Feature Requests
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Bugs with Mono or any data provider in Mono should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have a Bugzilla user account, it is free
|
||||
and easy to create
|
||||
one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
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>.
|
||||
|
||||
<li>Any RFE (Request For Enhancement) for features missing or new functionality
|
||||
should be entered as a bug in Bugzilla too</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** ADO.NET Data Providers
|
||||
|
||||
<p>List of ADO.NET Data Providers working in Mono:
|
||||
|
||||
<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>
|
||||
</ul>
|
||||
* Action plan
|
||||
|
||||
<p>Providers which we do not have, but we would like to have. Currently,
|
||||
some of these databases are supported via the ODBC or OLE DB providers.
|
||||
<p>The current plan to implement ADO.NET is as follows:
|
||||
|
||||
<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.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>
|
||||
<li><a href="http://www-3.ibm.com/software/data/informix/">Informix</a></li>
|
||||
<li><a href="http://msdn.microsoft.com/vfoxpro/">Foxpro</a></li>
|
||||
<li>Microsoft Access - could be done by creating C# bindings to <a href="http://mdbtools.sourceforge.net">MDB Tools</a></li>
|
||||
<li>dbase or xbase type database files</li>
|
||||
<li>Others are welcome</li>
|
||||
</ul>
|
||||
|
||||
<p>External Projects that have created ADO.NET Providers that work on Mono:
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="http://www.go-mono.com/firebird.html">Firebird Interbase</a></li> is a
|
||||
Firebird SQL Managed data provider. It can be used with Interbase databases too. It
|
||||
is written in 100%C# and does not require a client library. Works on .NET and Mono.</a>
|
||||
<li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a> is a
|
||||
PostgreSQL Managed data provider written
|
||||
in 100% C#, does not require a client library, and works on .NET and Mono</li>
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a
|
||||
MySQL Managed data provider written in 100% C#, does not
|
||||
require a client library, and works on .NET and Mono</li>
|
||||
</ul>
|
||||
|
||||
** Tools
|
||||
|
||||
<p>Some tools that can be used for ADO.NET and other technologies (ASP.NET, XML, etc).
|
||||
|
||||
<ul>
|
||||
<li><b>SQL# CLI</b> - a SQL query tool with a command-line interface.
|
||||
It can be used to enter and execute SQL statements or
|
||||
execute a batch of SQL commands from a file. It can
|
||||
be used to test connection strings, connect to various ADO.NET
|
||||
providers, save output to text, html, or xml. It is a work-in-progress.
|
||||
The SQL# CLI is distributed with the
|
||||
Mono runtime and class libraries as an executable assembly sqlsharp.exe.
|
||||
The source to SQL# CLI can be found in the mcs source at
|
||||
mcs/tools/SqlSharp/SqlSharpCli.cs
|
||||
</li>
|
||||
|
||||
<li><p><b>SQL# GUI - a graphical SQL query tool</b> allows a user
|
||||
to enter SQL commands in a top panel which is a text editor. It
|
||||
has a toolbar and menu for various tasks, such as, executing
|
||||
SQL commands one-at-a-time or in a batch. The results would appear
|
||||
in a bottom panel in a grid or could be saved to a file (xml, html, csv).
|
||||
Also, the bottom panel would allow logging of SQL command executed.
|
||||
Currently, there is a <a href="http://go-mono.com/images/sqlsharp.png">SQL# For GTK#</a> which
|
||||
provides a GUI interface using the <a href="http://gtk-sharp.sourceforge.net">Gtk#</a> toolkit. SQL# For GTK#
|
||||
is a work-in-progress and can be found in the mcs source at
|
||||
mcs/tools/SqlSharp/gui/gtk-sharp</li>
|
||||
</ul>
|
||||
|
||||
<p>Tools we would like to have, but they have not been created yet:
|
||||
|
||||
<ul>
|
||||
<li><b>XML Schema Definition tool</b> <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpconxmlschemadefinitiontoolxsdexe.asp">xsd.exe</a> needs
|
||||
to be created. Maybe this TODO item should be at the System.XML web page instead.
|
||||
<ul>
|
||||
<li>Either create ADO.NET providers or modify pre-exiting ADO.NET providers to
|
||||
work with Mono
|
||||
|
||||
<ul>
|
||||
<li>Create ADO.NET Providers
|
||||
|
||||
<ul>
|
||||
<li>This tool
|
||||
would work like the xsd.exe tool included with
|
||||
the .NET Framework. The Xsd.exe tools has the
|
||||
following uses:
|
||||
<ul>
|
||||
<li><b>XDR to XSD</b> - used to generate an XML schema from an XDR (XML Data Reduced schema) file.
|
||||
XDR was used by Microsoft prior to XSD becoming a W3C recommendation. So, this needs
|
||||
to be supported for legacy reasons</li>
|
||||
<li><b>XML to XSD</b> - used to generate an XML schema from an XML file</li>
|
||||
<li><b>XSD to DataSet</b> - used to generate DataSet classes from an XSD schema file. The
|
||||
DataSet classes created can then be used with XML data</li>
|
||||
<li><b>XSD to Classes</b> - used to generate classes from an XSD schema file. The
|
||||
classes created can be used with System.XML.Serialization.XMLSerializer
|
||||
to read and write XML code that follows the schema</li>
|
||||
<li><b>Classes to XSD</b> - used to generate an XML schema
|
||||
from type(s) in a assembly file. The
|
||||
XML schema created by the tool defines the XML format used
|
||||
by System.XML.Serialization.XMLSerializer</li>
|
||||
</ul>
|
||||
<li>Xsd.exe is used to manipulate XML schemas that
|
||||
follow the http://www.w3.org/XML/Schema">XML Schema Definition (XSD)</a> language
|
||||
recommended by the <a href="http://w3.org/">World Wide Web Consortium (W3C)</a></li>
|
||||
|
||||
<li>How this tool could be created:
|
||||
<ul>
|
||||
<li>Write xsd.exe in C# and run on Mono</li>
|
||||
<li>Make sure we have XML Schema support in System.Xml.Schema. Currently,
|
||||
it is wrapped around libxlst</li>
|
||||
<li>XML serialization support in System.Data classes</li>
|
||||
<li>Create the TypedDataSetGenerator class in System.Data</li>
|
||||
<li>Using CodeDOM or Reflection.Emit to create code</li>
|
||||
<li>Make sure DataSet, XmlDataDocument, and related classes
|
||||
are implemented fully</li>
|
||||
</ul>
|
||||
</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.
|
||||
<ul>
|
||||
<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>
|
||||
<li>Microsoft Access - could be done by creating C# bindings to <a href="http://mdbtools.sourceforge.net">MDB Tools</a></li>
|
||||
<li>dbase or xbase type database files</li>
|
||||
<li>Others are welcome</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<br>
|
||||
<li>Modify Pre-existing ADO.NET Providers to work with Mono. This may
|
||||
require fixing or implementing areas of Mono too.
|
||||
<ul>
|
||||
<li><a href="http://www.go-mono.com/firebird.html">Firebird Interbase</a></li>
|
||||
<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>
|
||||
</li>
|
||||
|
||||
<li><b>Application XML Configuration File Editor</b> - a tool
|
||||
to create and edit an application configuration file, such as,
|
||||
we have a .net application named Accouting.exe, the tool could edit
|
||||
the application configuration file Accounting.exe.config so a user could
|
||||
connect to the database used by the program. This tool has not
|
||||
been created.</li>
|
||||
|
||||
</ul>
|
||||
<br>
|
||||
<li>Create Tools for Configuration, Testing, and Entering SQL Queries
|
||||
<ul>
|
||||
<li><b>SQL# CLI - a command-line tool</b> written in C# to
|
||||
execute SQL commands,
|
||||
test connection strings, and connect to various ADO.NET
|
||||
providers in Mono. The SQL# CLI can be found in
|
||||
mcs/tools/SqlSharp/SqlSharpCli.cs</li>
|
||||
<li><p><b>SQL# GUI - a GUI tool</b> written in C# to
|
||||
execute SQL commands.
|
||||
Currently, there is SQL# For GTK# which
|
||||
can be found at
|
||||
mcs/tools/SqlSharp/gui/gtk-sharp
|
||||
It has a SQL editor with
|
||||
syntax hi lighting of SQL keywords</li>
|
||||
<li><b>Configuration Command-Line and GUI Tools for ADO.NET</b>.
|
||||
These tools have not been started. The tools would be written in
|
||||
C# and run on Mono. The
|
||||
configuration tool can be used to do the following:
|
||||
<ul>
|
||||
<li>bebased on the Application XML Configuration File Editor</li>
|
||||
<li>setup DSNs for the ODBC and OLE-DB
|
||||
providers and configurations for
|
||||
their underlying libraries (unixODBC and libgda)</li>
|
||||
@@ -239,85 +85,36 @@
|
||||
freetds.conf for Microsoft SQL Server and Sybase</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
|
||||
** Extra Classes in Mono ADO.NET
|
||||
|
||||
<p>An ADO.NET <a href="http://www.go-mono.com/provider-factory.html">Provider Factory</a>
|
||||
was created by Brian Ritchie. The
|
||||
Provider Factory is a way to dynamically create
|
||||
connections, commands, parameters, and data adapters based on configuration
|
||||
information.
|
||||
|
||||
** Current Status
|
||||
|
||||
<p>Various ADO.NET Providers have been created at various stages of
|
||||
development including:
|
||||
Firebird/Interbase, IBM DB2 Universal Database, MySQL, ODBC, OLE DB, Oracle,
|
||||
PostgreSQL, SQL Lite, Sybase, Microsoft SQL Server, and TDS Generic.
|
||||
See their respective web page for more information.
|
||||
|
||||
<p><b>Data Relations</b> via DataRelation, DataRelationCollection, and
|
||||
other classes have not been implemented
|
||||
|
||||
<p><b>Constraints</b> need lots of work
|
||||
|
||||
<p><b>XML Schema Definition tool</b> xsd.exe that is included
|
||||
in the .NET Framework has not been created for Mono
|
||||
|
||||
<p><b>TypeDataSetGenerator</b> needs to be stubbed and implemented.
|
||||
<p>Variouls ADO.NET Providers have been created: PostgreSQL, MySQL, Sybase, SQL Lite,
|
||||
Microsoft SQL Server, OLE DB, ODBC, and TDS Generic. See their respective web page for
|
||||
more information.
|
||||
|
||||
<p><b>DataSet, DataAdaptor, DataTable, DataRelation, DataRow, DataColumn,
|
||||
DataColumnCollection, DataRowCollection, and others</b> need more work. There are
|
||||
many classes that are just stubs and need to be implemented. Ville Palo has been
|
||||
doing much testing here.
|
||||
many classes that are just stubs and need to be implemented.
|
||||
|
||||
<p><b>XML support in System.Data</b> needs work. This involves working on
|
||||
the classes: DataSet, XmlDataDocument, and the method ExecuteXmlReader() that
|
||||
exists in a provider's class that implements IDbCommand, and others.
|
||||
Stuart Caborn has started the XML support in a DataSet. Tim Coleman started
|
||||
XML support in the ExecuteXmlReader() in a SqlCommand. Ville Palo has been
|
||||
heavily modifying DataSet, XmlDataDocument, and other classes for reading
|
||||
and writing XML. XML Serialization support in DataSet needs to be implemented.
|
||||
|
||||
<p><b>Integration with ASP.NET</b> has been created. Data binding of
|
||||
a DataTable in a DataSet to a System.Web.UI.WebControls.DataGrid works. Data binding
|
||||
of other types works too.
|
||||
XML support in the ExecuteXmlReader() in a SqlCommand.
|
||||
|
||||
<p><b>Database Access from ASP.NET</b>:
|
||||
<ul>
|
||||
<li>Take a look at xsp in cvs and look at the examples in test: dbpage1.aspx
|
||||
and dbpage2.aspx:
|
||||
<ul>
|
||||
<li>Notice that the namespace System.Data is imported via <b>import</b></li>
|
||||
<li>A NameValueCollection is gotten using ConfigurationSettings.AppSetings. These
|
||||
settings are gotten from the file server.exe.config which is a XML file. The XML
|
||||
file has a section appSettings. In the appSettings section, you have keys
|
||||
for DBProviderAssembly, DBConnectionType, and DBConnectionString.
|
||||
<ul>
|
||||
<li><b>DBProviderAssembly</b> is the assembly of the ADO.NET provider.
|
||||
For example:
|
||||
"Mono.Data.PostgreSqlClient"</li>
|
||||
<li><b>DBConnectionType</b> is the System.Type of the class that
|
||||
implements System.Data.IDbConnection that is found
|
||||
in the DBProviderAssembly.
|
||||
For example:
|
||||
"Mono.Data.PostgreSqlClient.PgConnection"</li>
|
||||
<li><b>DBConnectionString</b> is the ConnectionString to set to the
|
||||
IDbConnection object to use in opening a connection to a data source.
|
||||
For Example:
|
||||
"hostaddr=127.0.0.1;user=monotest;password=monotest;dbname=monotest"</li>
|
||||
</ul>
|
||||
<li>The function GetConnectionData() gets the database provider assembly, connection type,
|
||||
and connection string parameters if they exist; otherwise, it uses default values. This is
|
||||
done during the loading of the web page.</li>
|
||||
<li>With the connection parameters, the assembly is loaded, the connection type is verified that
|
||||
it implements IDbConnection and an instance of the class can be created, creates a instance
|
||||
of the class, sets the connection string, and opens the connection.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p><b>ADO.NET Provider Factory</b> has been started by Brian Ritchie. The
|
||||
Provider Factory is used to dynamically create
|
||||
connections, commands, parameters, and data adapters based on configuration information. This
|
||||
provider factory can also provide utility functions needed by a lot of
|
||||
providers but are not exposed via the provider.
|
||||
|
||||
<p><b>Integration with ASP.NET</b> has not been started, such as, data binding
|
||||
to a System.Web.UI.WebControls.DataGrid. This may involve implementing many classes
|
||||
in System.Web and System.Data. Gonzalo, Gaurav, Leen, Patrik, Duncan, and others are
|
||||
working very hard on the ASP.NET support. If you want to help,
|
||||
contact <a href="mailto:[email protected]">Gonzalo Paniagua Javier</a>
|
||||
|
||||
<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
|
||||
@@ -327,12 +124,33 @@
|
||||
has not been started, such as, data binding
|
||||
to a GtkTreeView. This may involve creating new classes
|
||||
to go between the glist data model and the ADO.NET data model.
|
||||
Mike Kestner or Rachel Hestilov would be the best people to ask for help on GTK#.
|
||||
Mike Kestner would be the best person to ask for help on GTK#.
|
||||
|
||||
<p><b>Integration with QT#</b> has not been started. Any information on
|
||||
how this can be done is appreciated. Adam Treat would be the best
|
||||
person to ask about QT#.
|
||||
|
||||
<p><b>Integration with GDA#</b> has not been started. It is
|
||||
included in the GTK# project, GDA#
|
||||
does not require GTK+ nor GNOME. GDA# is C# bindings
|
||||
to <a href="http://www.gnome-db.org/">GDA</a> which
|
||||
is an ADO/OLE-DB like layer for Linux provided as a C library. Classes
|
||||
that would bind data between the ADO.NET data model and the GDA data model will
|
||||
need to be created. Rodrigo Moya is the best person to contact about this.
|
||||
|
||||
<p><b>Integration with GnomeDb#</b> has not been started. It is
|
||||
included in the GTK# project and uses GDA# for its data access model.
|
||||
Creating classes to bind data between the data model in ADO.NET
|
||||
and the data model that exists in GDA# and GnomeDb# will
|
||||
need to be started. GnomeDb# is C# bindings to
|
||||
<a href="http://www.gnome-db.org/">GnomeDb</a> which uses
|
||||
<a href="http://www.gnome-db.org/">GDA</a> as its data access layer. GnomeDb
|
||||
is a C API in a library that contains
|
||||
gtk+ widgets (GUI controls) for data access. There are some nifty widgets
|
||||
(GUI controls) that can be used, such as, GnomeDbGrid, GnomeDbBrowswer,
|
||||
GnomeDbSqlEditor, GnomeDbList, GnomeDbLogin, GnomeDbReportEditor, GnomeDbTableEditor,
|
||||
GnomeDbCombo, and GnomeDbForm. Rodrigo Moya is the best person to contact.
|
||||
|
||||
<p><b>Building System.Data</b>
|
||||
|
||||
<p>The System.Data.dll gets built with the rest of the class library.
|
||||
@@ -376,71 +194,3 @@
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
** Testing
|
||||
|
||||
<ul>
|
||||
<li>Testing connection-oriented classes are done
|
||||
via the provider specific tests
|
||||
found in the mcs source at mcs/class</br>
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td><b>Name</b></td>
|
||||
<td><b>Assembly /</br> Namespace</b></td>
|
||||
<td><b>Test</b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Microsoft</br> SQL</br> Server</br></td>
|
||||
<td>System.Data /</br> System.Data.SqlClient</td>
|
||||
<td>SqlTest.cs at</br> System.Data/Test</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>PostgreSQL</br> (Mono)</td>
|
||||
<td>Mono.Data.PostgreSqlClient /</br> Mono.Data.PostgreSqlClient</td>
|
||||
<td>PostgresTest.cs at</br> System.Data/Test</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>MySQL</br> (Mono)</td>
|
||||
<td>Mono.Data.MySql /</br> Mono.Data.MySql</td>
|
||||
<td>MySqlTest.cs at</br> Mono.Data.MySql/Test</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Oracle</br> (Mono)</td>
|
||||
<td>System.Data.OracleClient /</br> System.Data.OracleClient</td>
|
||||
<td>TestOracleClient.cs at</br> System.Data.OracleClient</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>ODBC</br> (Mono)</td>
|
||||
<td>System.Data.OracleClient /</br> System.Data.OracleClient</td>
|
||||
<td>TestOracleClient.cs at</br> System.Data.OracleClient</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<li><a href="http://www.go-mono.com/testing.html">Testing non-connection classes</a> are
|
||||
done via mono's modified version of NUnit.
|
||||
<ul>
|
||||
<li>To run all the NUnit tests for Mono, you need the mcs source. cd to the root
|
||||
of the mcs source. To run it:
|
||||
<ul>
|
||||
<li>On Linux: make -f makefile test</li>
|
||||
<li>On Windows: make test</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>If you just want to run the NUnit tests for System.Data, you would cd into
|
||||
the mcs source at class/System.Data/Test and run it:
|
||||
<ul>
|
||||
<li>On Linux: make -f makefile test</li>
|
||||
<li>On Windows: make test</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
+56
-33
@@ -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
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
A Retargetable C Compiler - Design and Implementation: C. Fraser, David
|
||||
Hanson
|
||||
|
||||
* Threading
|
||||
|
||||
.NET Multithreading: Alan L. Dennis (ISBN 1-930110-54-5)
|
||||
|
||||
* Reference Manuals
|
||||
|
||||
<a
|
||||
@@ -38,4 +34,4 @@
|
||||
MIPS Processor supplement</a>
|
||||
|
||||
<a href="http://www.sparc.org/standards/V8.pdf">The SPARC Architecture
|
||||
Manual Version 8</a>
|
||||
Manual Version 8</a>
|
||||
@@ -35,9 +35,6 @@
|
||||
<li><a
|
||||
href="http://www.go-mono.com/class-status-System.Runtime.Serialization.Formatters.Soap.html">System.Runtime.Serialization.Formatters.Soap</a>.
|
||||
|
||||
<li><a
|
||||
href="http://www.go-mono.com/class-status-System.Security.html">System.Security</a>:
|
||||
Xml Signature Security classes, also check the <a href="crypto.html">Cryptography status pages</a>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
+33
-11
@@ -8,31 +8,53 @@
|
||||
multilingual documentation makes for significant additional text.
|
||||
|
||||
With these considerations in mind, Mono will use external XML files
|
||||
for type documentation, rather than documenting the source
|
||||
inline. The XML file format used is inspired by the XML format used
|
||||
to document the ECMA APIs.
|
||||
|
||||
for type documentation, rather than documenting the source inline.
|
||||
|
||||
Several tools will be created for managing, verifying, generating,
|
||||
and updating class library documentation, including:
|
||||
|
||||
<ul>
|
||||
<li><a href="#monodoc">monodoc - A graphical documentation viewer.</a></li>
|
||||
<li>xmllint: a tool used to validate a proper XML document.
|
||||
<li><a href="#monodoc">MonoDoc - A graphical documentation editor and viewer.</a></li>
|
||||
<li><a href="#mkmaster">MkMaster - A command line tool to feed stub information to MonoDoc.</a></li>
|
||||
<li><a href="#aspnet">An ASP.NET documentation editor.</a></li>
|
||||
<li><a href="#xsltool">An xsl tool to convert monodoc xml to html documentation.</a></li>
|
||||
</ul>
|
||||
|
||||
You can download the tools to document Mono from the CVS
|
||||
repository from module `monodoc'.
|
||||
** XML Documentation Files and Formats
|
||||
|
||||
|
||||
*** Monodoc XML
|
||||
This XML is Mono's documentation format. Documentation and a DTD/Schema
|
||||
for Monodoc XML is located in cvs and can be found <a href="http://go-mono.org/monodoc.dtd">here</a>.
|
||||
|
||||
This XML could be generated by MonoDoc or the ASP.NET client.
|
||||
|
||||
More about the XML format <a href="http://go-mono.org/monodoc-xml.html">here</a>.
|
||||
** Documentation Tools
|
||||
|
||||
*** <a name="monodoc">MonoDoc</a>
|
||||
A graphical documentation editor and viewer. Currently, MonoDoc
|
||||
consists of a Qt# application and is in heavy development.
|
||||
|
||||
A graphical documentation viewer written in Gtk#. In the
|
||||
future we will have an ASP.NET front-end to present the
|
||||
documentation on the web as well.
|
||||
*** <a name="mkmaster">MkMaster</a>
|
||||
This tool creates the Master.xml file that MonoDoc uses as a reference
|
||||
for documentation generation. This is a reflection engine that is used
|
||||
to gather metadata from assemblies and create an xml representation.
|
||||
|
||||
*** <a name="aspnet">ASP.NET</a>
|
||||
This tool is planned.
|
||||
|
||||
*** <a name="xsltool">An XSL converter</a>
|
||||
This tool is planned. If someone wants to step forward and adopt this
|
||||
project, it would be very helpful ;)
|
||||
|
||||
** Status and Roadmap
|
||||
|
||||
*** 16, September 2002
|
||||
|
||||
A preliminary version of MonoDoc is in Mono's cvs. It is under heavy development.
|
||||
Once this is complete we will start documenting the API!
|
||||
|
||||
** Get Involved
|
||||
|
||||
Help us develop Mono's documentation tools! Subscribe to
|
||||
|
||||
+57
-67
@@ -13,32 +13,28 @@
|
||||
<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
|
||||
<ul>
|
||||
* Support for adding/modifying OID using the
|
||||
<code>machine.config</code> configuration file (algorithms
|
||||
are done).
|
||||
* Support for adding/modifying algorithms and OID using the
|
||||
<code>machine.config</code> configuration file (in progress).
|
||||
|
||||
* RNGCryptoServiceProvider is currently only working on Linux.
|
||||
The current implementation reside in Mono's runtime and use
|
||||
the <code>/dev/[u]random</code> device (which do not exists
|
||||
under Windows). A Windows alternative is in the work (see
|
||||
Mono.Security.Win32 assembly section).
|
||||
under Windows). A Windows alternative is in the work...
|
||||
|
||||
* Keypair persistance for RSA and DSA. This persistance must
|
||||
somehow be linked with X509 certificate stores (in planning).
|
||||
|
||||
* <code>PasswordDeriveBytes.CryptDeriveKey</code> is included
|
||||
in the BCL to provide compatibility with existing Windows
|
||||
applications. The main problem is that the key derivation
|
||||
algorithm can be different for every CSP (Crypto Service
|
||||
Provider). However for compatibility we should provide an
|
||||
implementation compatible with the MS CSP (most likely used).
|
||||
* <code>PasswordDeriveBytes</code> is currently limited to
|
||||
generating keys with the maximum length equals to the hash
|
||||
output (as specified in PKCS #5). However the framework
|
||||
implementation allows for longer keys to be generated. Also
|
||||
the algorithms used by CryptDeriveKey (used by Windows
|
||||
applications) are unknown.
|
||||
|
||||
* Analyse the current coverage of the unit tests on the
|
||||
cryptographic classes and complete the unit tests.
|
||||
@@ -61,8 +57,7 @@
|
||||
|
||||
**** Status
|
||||
<ul>
|
||||
* X.509 certificates are parsed using 100% managed code
|
||||
(using an internal ASN.1 class).
|
||||
* X.509 certificates are parsed using 100% managed code.
|
||||
|
||||
* Software Publisher Certificates (SPC) used by Authenticode
|
||||
(tm) to sign assemblies are supported (extraction from PE
|
||||
@@ -80,28 +75,26 @@
|
||||
* Authenticode(tm) support is incomplete. We can extract the
|
||||
certificates from PE files but cannot validate the signature
|
||||
nor the certificate chain (and we're still missing some trust
|
||||
anchors). See Tools section for more information.
|
||||
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 (except when used for Authenticode, i.e.
|
||||
<code>CreateFromSignedFile</code>).
|
||||
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 (unmanaged). From the exceptions
|
||||
thrown Authenticode(tm) support is done via COM.
|
||||
done by using CryptoAPI. From the exceptions thrown
|
||||
Authenticode(tm) support is done via COM.
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
@@ -109,38 +102,47 @@
|
||||
|
||||
*** 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>
|
||||
* All classes are present but some (Transforms) are only
|
||||
stubbed.
|
||||
* All classes are present but some are only stubbed.
|
||||
|
||||
* 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). In the short
|
||||
term <code>libxml2</code> could be used to provide C14N, but
|
||||
in the long term a fully managed class would be much better.
|
||||
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>.
|
||||
@@ -154,22 +156,16 @@
|
||||
<ul>
|
||||
* A RNGCryptoServiceProvider built on top of CryptoAPI.
|
||||
|
||||
* Wrapper classes for unmanaged versions of hash algorithms:
|
||||
MD2, MD4, MD5 and SHA1 are supported. <b>note</b>: some
|
||||
algorithms shouldn't be used in new design (MD4 is broken and
|
||||
MD2 isn't considered safe). They are included to preserve
|
||||
interoperability with older applications (e.g. some old, but
|
||||
still valid, X.509 certificates use MD2).
|
||||
* Not (yet) commited in CVS.
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
<ul>
|
||||
* Wrapper classes for unmanaged versions of symmetric
|
||||
encryption algorithms (like DES, TripleDES, RC2 and others
|
||||
present in default CSP).
|
||||
* Wrapper classes for unmanaged versions of asymmetric
|
||||
algorithms (like DSA and RSA) which persist their keypair
|
||||
into the specified CSP.
|
||||
* Unmanaged versions of hash algorithms (SHA1 and MD5).
|
||||
* Unmanaged versions of symmetric encryption algorithms
|
||||
(like DES, TripleDES, RC2 and others present in CryptoAPI).
|
||||
* Unmanaged versions of asymmetric algorithms (like DSA and
|
||||
RSA) which persist their keypair into the specified CSP.
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
@@ -183,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
|
||||
@@ -231,8 +226,6 @@
|
||||
|
||||
There are many tools in the .NET framework that indirectly interacts
|
||||
with some cryptographic classes. Mono will eventually need these tools.
|
||||
Unless noted the tools should work on any CLR (tested with both Mono
|
||||
and Microsoft).
|
||||
|
||||
**** Status
|
||||
|
||||
@@ -243,8 +236,8 @@
|
||||
re-used in source code (C# or VB.NET syntax).
|
||||
|
||||
* <code>cert2spc</code> is a tool to transform multiple X.509
|
||||
certificates and CRLs into a Software Publisher Certificate
|
||||
(SPC) file - which is a long name for a simple PKCS#7 file.
|
||||
certificates (a chain) into a Software Publisher Certificate
|
||||
(SPC) - which is a long name for a simple PKCS#7 file.
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
@@ -252,11 +245,10 @@
|
||||
<ul>
|
||||
* <code>monosn</code> is a clone of the <code>sn</code> to manage
|
||||
strongnames. This tools is part of the runtime (not the class
|
||||
library) and as such is written in C and won't run without Mono.
|
||||
library) and as such is written in C.
|
||||
|
||||
* <code>signcode</code> and <code>chktrust</code> (in progress)
|
||||
for signing and validating Authenticode(tm) signatures on
|
||||
assemblies (or any PE file).
|
||||
* <code>signcode</code> and <code>chktrust</code> for signing
|
||||
and validating Authenticode(tm) signatures on assemblies.
|
||||
|
||||
* <code>makecert</code> to create X.509 test certificates that
|
||||
can be used (once transformed in SPC) to sign assemblies.
|
||||
@@ -275,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)
|
||||
@@ -286,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: February 5, 2003 (post mono 0.19)
|
||||
+3
-192
@@ -14,16 +14,13 @@
|
||||
<ul>
|
||||
|
||||
* The development tools (compilers, assembler tools,
|
||||
language reference, design time features): these
|
||||
live in the `monodoc' CVS module.
|
||||
language reference, design time features).
|
||||
|
||||
* Frequently Asked Question compilations.
|
||||
|
||||
* HOWTO documents.
|
||||
|
||||
* The Class Libraries (Both the original .NET class
|
||||
libraries as well as the class libraries produced by
|
||||
the project).
|
||||
* The Class Libraries
|
||||
|
||||
* Tutorials on Mono and the specifics of running it.
|
||||
|
||||
@@ -32,197 +29,11 @@
|
||||
|
||||
</ul>
|
||||
|
||||
* Class Library documentation
|
||||
** Class Library documentation
|
||||
|
||||
We are moving to a new setup for documenting the class libraries,
|
||||
and you can read about it <a href="classlib-doc.html">here</a>.
|
||||
|
||||
There are two classes of documentation: free documentation for
|
||||
existing .NET classes and documentation for the classes that
|
||||
we have developed on top of .NET.
|
||||
|
||||
There is a large body of documentation that came from the ECMA
|
||||
standarization effort that has been checked into CVS. It does
|
||||
not contain everything Mono and .NET have, so they need to be
|
||||
updated and augmented.
|
||||
|
||||
** Gtk# documentation
|
||||
|
||||
We also have a large body of class libraries that are specific
|
||||
to Mono, for example the documentation for Gtk#.
|
||||
|
||||
We have checked in stub documentation for Gtk# into the CVS
|
||||
repository (on gtk-sharp/doc) and we need volunteers to help
|
||||
populate the documentation for it. Since Gtk# is a wrapper
|
||||
for Gtk, plenty of documentation exists in the <a
|
||||
href="http://developer.gnome.org/doc/API">Gnome developer
|
||||
site</a>.
|
||||
|
||||
To get started:
|
||||
|
||||
You need to download Gtk# from the CVS repository. The module
|
||||
name is `gtk-sharp'. You can obtain a copy from both the CVS
|
||||
repository or the anonymous CVS repository.
|
||||
|
||||
To pull your copy type:
|
||||
|
||||
<pre>
|
||||
cvs co gtk-sharp
|
||||
</pre>
|
||||
Documentation lives in gtk-sharp/doc/en. The "en" indicates the
|
||||
English language, the first one we are targeting. We can later
|
||||
do translations, but for now we are focusing on a single
|
||||
language.
|
||||
|
||||
In that directory you will find the documentation organized by
|
||||
namespaces. One directory per namespace. In the directories
|
||||
you will find one XML file per class that needs to be
|
||||
documented. The mission is to fill in the data with useful
|
||||
information. Feel free to grab liberally information from the
|
||||
Gtk documentation from:
|
||||
|
||||
<a href="http://developer.gnome.org/doc/API/">http://developer.gnome.org/doc/API/</a>
|
||||
|
||||
Of course, the API does not apply directly. It only applies at
|
||||
a foundational level, so you can not really just copy and
|
||||
paste. Summaries, and remarks sections can probably be lifted
|
||||
with little or no effort.
|
||||
|
||||
Gtk# uses properties to represent get/set operations in the C
|
||||
API, so you can also use some bits from there.
|
||||
|
||||
Most of the documentation contains already place holders for
|
||||
text, we use the internationally approved phrase for this
|
||||
purpose, `To be added'. So the quest is to remove all of the
|
||||
"To be added" strings with information with resembles as closely
|
||||
as possible the toolkit reality.
|
||||
|
||||
*** The pieces to be filled.
|
||||
|
||||
Summaries are one or two line descriptions of the element
|
||||
(class, struct, interface, method, field, event, delegate), and
|
||||
its used to render summary pages. So it has to be short.
|
||||
|
||||
The "remarks" section is used to describe in detail the element.
|
||||
|
||||
**** Tags.
|
||||
|
||||
As you document Gtk# you will have a number of tags that you can
|
||||
use inside the summary and remarks sections, these are:
|
||||
|
||||
<pre>
|
||||
<para> </para>
|
||||
</pre>
|
||||
Used to separate paragraphs.
|
||||
|
||||
<pre>
|
||||
<paramref name="param_name"/>
|
||||
</pre>
|
||||
Used to reference a formal parameter to a function.
|
||||
|
||||
<pre>
|
||||
<see cref="T:SomeTypeName"/>
|
||||
</pre>
|
||||
Use this to reference a type, this will include an hyper
|
||||
link to the page for type SomeTypeName.
|
||||
|
||||
For example, to reference "System.Enum", do:
|
||||
|
||||
<pre>
|
||||
<see cref="T:System.Enum"/>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<see cref="P:SomeTypeName.Property"/>
|
||||
</pre>
|
||||
Use this to reference a property, this will include an hyper
|
||||
link to the page for the property `Property' of type `SomeTypeName'.
|
||||
|
||||
For example, to reference the BaseType property in System.Type, do:
|
||||
|
||||
<pre>
|
||||
<see cref="P:System.Type.BaseType"/>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<see cref="M:SomeTypeName.Method(type,type)"/>
|
||||
</pre>
|
||||
Use this to reference a method, this will include an hyper
|
||||
link to the page for the method `Method' of type `SomeTypeName'.
|
||||
|
||||
For example, to reference the ToString method in System.Object, do:
|
||||
|
||||
<pre>
|
||||
<see cref="M:System.Object.ToString()"/>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<see langword="keyword"/>
|
||||
</pre>
|
||||
Use this to link to a keyword in the C# language, for
|
||||
example to link to `true', do:
|
||||
|
||||
<pre>
|
||||
<see langword="true"/>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<example> ... </example>
|
||||
</pre>
|
||||
Use example to insert an example. The example can
|
||||
contain explanatory text and code.
|
||||
|
||||
<pre>
|
||||
<code lang="C#">.. </code>
|
||||
</pre>
|
||||
|
||||
Use this to provide a sample C# program, typically used
|
||||
within the <example> tags.
|
||||
|
||||
When providing examples, try to provide a full example,
|
||||
we would like to be able to have a button to compile and
|
||||
run samples embedded into the documentation, or pop up
|
||||
an editor to let the user play with the sample.
|
||||
|
||||
You can link to an example like this:
|
||||
|
||||
<pre>
|
||||
<code lang="C#" source="file.cs"> </code>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<item>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<list type="bullet"> </list>
|
||||
</pre>
|
||||
|
||||
Use this to create lists. Lists contains <item>
|
||||
elements
|
||||
|
||||
<pre>
|
||||
<list type="table"> </lits>
|
||||
<listheader>
|
||||
<term>YOUR FIRST COLUMN</term>
|
||||
<description>YOUR DESCRIPTION</description>
|
||||
</listheader>
|
||||
</pre>
|
||||
For two-column tables. Inside use:
|
||||
|
||||
<pre>
|
||||
<item>
|
||||
<term>First</term>
|
||||
<description>First descritpion</description>
|
||||
</item>
|
||||
<item>
|
||||
<term>Second</term>
|
||||
<description>Second descirption</description>
|
||||
</item>
|
||||
</pre>
|
||||
|
||||
** Words of warning.
|
||||
|
||||
A few words of warning and advice for class documentors:
|
||||
|
||||
A well-documented API can ease hours of frustration; as Mono
|
||||
|
||||
+89
-227
@@ -13,232 +13,6 @@
|
||||
section</a>, the <a
|
||||
href="http://www.go-mono.org/faq.html">FAQ</a>.
|
||||
|
||||
<b>Important</b>: The contributed binaries for Windows
|
||||
binaries of Mono 0.20 contained a virus. Please read <a
|
||||
href="virus.html">this</a> if you installed the binary.
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="#DDDDDD">
|
||||
<td>
|
||||
<b>Release 0.20</b><br>
|
||||
<a href="archive/mono-0.20">Release notes</a><br>
|
||||
Jan 20th, 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.20.tar.gz">Mono Class Libraries and C# Compiler.</a>
|
||||
<li><a href="archive/mono-0.20.tar.gz">Mono Runtime</a>
|
||||
<li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
|
||||
<li><a href="archive/xsp-0.3.tar.gz">XSP web server (0.3)</a>
|
||||
<li><a href="archive/mono-debugger-0.2.0.tar.gz">Mono Debugger 0.2.0</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.20-1.src.rpm">mono-0.20-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.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-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.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-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.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-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.20-1.i586.rpm">mono-0.20-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-devel-0.20-1.i586.rpm">mono-devel-0.20-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.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-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.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-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.20-stable-win32-2.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">
|
||||
<td>
|
||||
<b>Release 0.19</b><br>
|
||||
<a href="archive/mono-0.19">Release notes</a><br>
|
||||
Jan 20th, 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.19.tar.gz">Mono Class Libraries and C# Compiler.</a>
|
||||
<li><a href="archive/mono-0.19.tar.gz">Mono Runtime</a>
|
||||
</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.19-1.src.rpm">mono-0.19-1.src.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<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>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="#DDDDDD">
|
||||
@@ -258,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>
|
||||
@@ -273,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>
|
||||
@@ -290,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">
|
||||
@@ -347,6 +201,14 @@
|
||||
</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>
|
||||
@@ -685,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.
|
||||
+7
-103
@@ -1,30 +1,22 @@
|
||||
* Firebird and Interbase Data Provider
|
||||
|
||||
<ul>
|
||||
<li>ADO.NET Data Provider for Firebird and Interbase databases</li>
|
||||
|
||||
<li>Does not exist in Mono, but is a separate project</li>
|
||||
|
||||
<li>The <a href="http://firebird.sourceforge.net/index.php">Firebird Relational Database</a> is
|
||||
is an independent project which uses source code based on the Interbase source code released
|
||||
<li><a href="http://firebird.sourceforge.net/index.php">Firebird Relational Database</a> is
|
||||
an independent project which uses source code based on the Interbase source code released
|
||||
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
|
||||
number of contributions to the OdbcJdbc code</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
available by Carlos Guzmán Álvarez (aka "Carlos G.A."), who has also made a
|
||||
number of contributions to the OdbcJdbc code</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Current Status
|
||||
* Current Status
|
||||
|
||||
<ul>
|
||||
<li>Currently, it is able to connect to Firebird and Interbase databases
|
||||
@@ -64,7 +56,7 @@
|
||||
|
||||
</ul>
|
||||
|
||||
** Action Plan
|
||||
* Action Plan
|
||||
|
||||
<ul>
|
||||
<li>Bug fixing</li>
|
||||
@@ -106,91 +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>Has a ConnectionString format:
|
||||
<pre>
|
||||
"Database=databasefile.gdb;User=user;Password=pass;Dialect=3;Server=hostname"
|
||||
</pre>
|
||||
|
||||
</li>
|
||||
|
||||
<li>C# Example:
|
||||
|
||||
<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);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql = "SELECT * FROM employee";
|
||||
dbcmd.CommandText = 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
-4
@@ -1,7 +1,9 @@
|
||||
* The GCC front-end
|
||||
|
||||
Jeremy Singer has developed a .NET backend for GCC, his
|
||||
research work is available <a
|
||||
href="http://www.cl.cam.ac.uk/~jds31/research/gccnet/">here</a>.
|
||||
The GCC front-end will accept input in a binary file with
|
||||
codes in the Common Intermediate Language (CIL), and generate
|
||||
native code.
|
||||
|
||||
This will allow pre-compilation and full optimization to take
|
||||
place before a program is executed.
|
||||
|
||||
|
||||
+6
-139
@@ -3,152 +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:
|
||||
<ul>
|
||||
<li><a href="http://gtk-sharp.sourceforge.net">RPMs</a></li>
|
||||
<li><a href="http://www.debianplanet.org/mono/">Debs</a></li>
|
||||
</ul>
|
||||
|
||||
<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 FreeBSD
|
||||
|
||||
TODO. Any volunteers?
|
||||
|
||||
** GTK# On Solaris
|
||||
|
||||
TODO. Any volunteers?
|
||||
|
||||
** GTK# On AIX
|
||||
|
||||
TODO. Any volunteers?
|
||||
-157
@@ -1,157 +0,0 @@
|
||||
* IBM DB2 Data Provider
|
||||
<ul>
|
||||
<li>ADO.NET Data Provider for <a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a></li>
|
||||
|
||||
<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 <a href="http://www.go-mono.com/odbc.html">System.Data.Odbc</a> ODBC provider, you will see the
|
||||
DllImport's have similiar function names.</li>
|
||||
|
||||
<li>IBM DB2 Provider created by Christopher Bockner.</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</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>
|
||||
|
||||
<li>Christopher says it can retrieve data via the DB2ClientDataReader</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>Has a ConnectionString format like ODBC</li>
|
||||
|
||||
<li>Here is a ConnectionString format if you have a DSN setup:
|
||||
<pre>
|
||||
"DSN=dataSetName;UID=myuserid;PWD=mypassword"
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
<li>Here is a ConnectionString format if you do not have a DSN (have not
|
||||
gotten this to work though, so, I am open to suggestions):
|
||||
<pre>
|
||||
"DRIVER={DB2 Driver};SERVER=localhost;DATABASE=test;UID=myuserid;PASSWORD=mypassword"
|
||||
</pre>
|
||||
</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);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"CREATE TABLE mono_db2_test1 ( " +
|
||||
" testid varchar(2), " +
|
||||
" testdesc varchar(16) " +
|
||||
")";
|
||||
dbcmd.CommandText = 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>
|
||||
|
||||
@@ -56,6 +56,11 @@ TODO=multimedia
|
||||
<a name="projects">
|
||||
** Projects
|
||||
|
||||
<ul>
|
||||
TODO=xmlStorage,
|
||||
* Implement an xmlStorageSystem for the CLI:
|
||||
<a href="http://www.soapware.org/xmlStorageSystem">
|
||||
http://www.soapware.org/xmlStorageSystem</a>
|
||||
|
||||
TODO=guavac,Java compiler for .NET
|
||||
* You could take one of the existing Java compilers
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
You might also want to <a href="download.html">Download the
|
||||
source</a> for our work so far. Grab a <a
|
||||
href="snapshots">snapshot</a> of our current work, or <a
|
||||
href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?hidenonreadable=1&f=u&logsort=date&sortby=file&hideattic=1&cvsroot=mono">browse
|
||||
href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?hidenonreadable=1&f=u&logsort=date&sortby=file&hideattic=1&cvsroot=Mono">browse
|
||||
the sources</a>
|
||||
|
||||
You might want to <a
|
||||
@@ -34,12 +34,6 @@
|
||||
|
||||
You can contact the team at: <a
|
||||
href="mailto:[email protected]">[email protected]</a>
|
||||
|
||||
In order to follow the process of the project and to learn more
|
||||
about the team members we have created the <a
|
||||
href="http://monoevo.sf.net/mwn/index.html">Mono Weekly News letter</a>.
|
||||
Which archives can be found <a
|
||||
href="http://monoevo.sf.net/mwn/archives.html">here</a>.
|
||||
</td>
|
||||
<td>
|
||||
<table border=1>
|
||||
@@ -92,176 +86,11 @@
|
||||
<a href="index.rss"><img src="images/xml.gif"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="screenshots.html">Screenshots</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@item Feb 25th, 2003: Mono 0.20 for Windows released; New Apache module released.
|
||||
|
||||
Packages of Mono for Windows have been <a
|
||||
href="archive/mono-0.20-stable-win32-2.exe">released</a>.
|
||||
Thanks to Daniel, Johannes and Paolo for setting this up.
|
||||
|
||||
Daniel has released a new version of his Mono Apache module that
|
||||
handles ASP.NET. The code is available at <a
|
||||
href="http://apacheworld.org/modmono/">here</a>
|
||||
|
||||
Nick has posted an update on the progress on our <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-February/012467.html">regression
|
||||
tests</a>. We are looking for more tests, and more volunteers to write them.
|
||||
|
||||
Also, remember to contribute to the Gtk# documentation effort,
|
||||
momentum is picking up! See the entry for Feb 18th for more details.
|
||||
|
||||
@item Feb, 23rd, 2003: Mono 0.20 released; Gtk# 0.8 released.
|
||||
|
||||
Mono 0.20 has been released. Check out the <a
|
||||
href="archive/mono-0.20">release notes</a> for an overview of
|
||||
the changes. You can get it <a href="download.html">here</a>.
|
||||
There are no major features in this release, mostly bug fixes
|
||||
and performance improvements.
|
||||
|
||||
Gtk# 0.8 has been <a
|
||||
href="http://lists.ximian.com/archives/public/gtk-sharp-list/2003-February/001114.html">released</a>
|
||||
|
||||
<b>Important</b>: The contributed binaries for Windows
|
||||
binaries of Mono 0.20 contain a virus. Please read <a
|
||||
href="virus.html">this</a> if you installed the binary.
|
||||
|
||||
@item Feb 18th, 2003: Volunteers to document Gtk#
|
||||
|
||||
With the availability of a documentation browser, we are
|
||||
looking for volunteers to help us complete the documentation
|
||||
of the Gtk# binding for Mono.
|
||||
|
||||
Experience with Gtk is useful, but not mandatory. We have
|
||||
checked in stubs, and we have instructions, and resources to
|
||||
how to complete this process <a
|
||||
href="documentation.html">here</a>. Mail the <a
|
||||
href="mailto:[email protected]">[email protected]</a>
|
||||
for further discussion.
|
||||
|
||||
@item Feb 14th, 2003: OpenGL# bindings for Mono; Mono Basic updates.
|
||||
|
||||
Mark Crichton has completed his OpenGL/GLUT bindings for
|
||||
Gnome. A screenshot can be seen <a
|
||||
href="sshots/oglcs.png">here</a>. The bindings are available
|
||||
on the Mono CVS repository on the module `glgen'. This is a
|
||||
straight binding to the C API.
|
||||
|
||||
Marco has <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-February/011752.html">posted
|
||||
an update</a> on the current state of the free VB.NET compiler
|
||||
for Mono.
|
||||
|
||||
We are looking for contributors and maintainers to the
|
||||
JavaScript compiler as well (Janet)
|
||||
|
||||
@item Feb 12th, 2003: New assemblies, Gtk# stub documentation, Authenticode, Polish site
|
||||
|
||||
Mono now distributes a few new assemblies: Mono.Security.Win32
|
||||
as a layer to use the crypto functionality on Win32. The
|
||||
Mono.Posix assembly which contains functionality for taking
|
||||
advantage of Unix facilities.
|
||||
|
||||
A <a href="http://www.go-mono.pl/">Mono site in Poland</a>.
|
||||
|
||||
Stubs for the Gtk# documentation have been checked into CVS.
|
||||
If you want to contribute please read <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-February/012108.html">this
|
||||
message</a>
|
||||
|
||||
Mono development is moving quickly: Tim and Daniel have been
|
||||
improving the Oracle database provider and Sebastien Pouliot
|
||||
has got code signing to work using Authenticode with pure open
|
||||
source and managed code. Plenty of new VB.NET work from Marco
|
||||
(compiler) and Daniel (runtime). Also Jackson has resumed
|
||||
work on the IL assembler and the fully managed library to
|
||||
generate CIL images (Sergey wrote the first Mono.PEToolkit).
|
||||
|
||||
@item Feb 11th, 2003: Mono Weekly News, New assemblies.
|
||||
|
||||
<a href="http://monoevo.sourceforge.net/mwn/index.html">Mono
|
||||
Weekly News</a>: Includes a new interview, software
|
||||
announcements and the PHP/Mono integration.
|
||||
|
||||
@item Feb 5th, 2003: MonoDoc 0.1
|
||||
|
||||
A <a
|
||||
href="http://www.go-mono.com/archive/monodoc-0.1.tar.gz">preliminary
|
||||
release</a> of the Mono Documentation Browser is now availble.
|
||||
Release <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-February/011935.html">notes</a>
|
||||
|
||||
@item Jan, 22th, 2003: Mono wins award, OpenLink releases Virtuoso.
|
||||
|
||||
Mono won the `Best Open Source Project' award at the Linux
|
||||
World Expo. A description is <a
|
||||
href="http://linuxtoday.com/news_story.php3?ltsn=2003-01-23-024-26-OP-EV">here</a>
|
||||
|
||||
Open Link has a <a
|
||||
href="http://biz.yahoo.com/prnews/030123/neth013_1.html">press
|
||||
release</a> about Virtuoso 3.0: the first commercial product
|
||||
shipping that uses Mono.
|
||||
|
||||
@item Jan, 20th, 2003: Mono 0.19 released; Screenshots page; Gtk# 0.7
|
||||
|
||||
Mono 0.19 has been released. Check out the <a
|
||||
href="archive/mono-0.19">release notes</a> for an overview of
|
||||
the changes. You can get it <a href="download.html">here</a>.
|
||||
There are no major features in this release, mostly bug fixes
|
||||
and performance improvements.
|
||||
|
||||
We have now a new section <a href="screenshots.html">with
|
||||
screenshots</a> of various Mono applications. You can see
|
||||
there the new released Debugger, as well as the work in
|
||||
progress on the documentation browser.
|
||||
|
||||
<a href="http://gtk-sharp.sf.net">Gtk# 0.7</a> has been <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-January/005222.html">released</a>
|
||||
|
||||
@item Jan, 19th, 2003: Mono Debugger released.
|
||||
|
||||
After six month of extensive development, Martin Baulig has
|
||||
released the first version of the Mono debugger. The Mono
|
||||
debugger is written in C# and can debug both managed and
|
||||
unmanaged applications, support for multiple-threaded
|
||||
applications and should be relatively easy to port to new
|
||||
platforms.
|
||||
|
||||
Details of the release are available in <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-January/005192.html">post</a>.
|
||||
|
||||
The debugger contains both Gtk# and command line interfaces.
|
||||
The debugging file format used in Dwarf (its already supported
|
||||
by our class libraries and the Mono C# compiler; To debug C
|
||||
applications, you need a recent GCC, or to pass the -gdwarf-2
|
||||
flag to gcc).
|
||||
|
||||
@item Jan, 17th, 2003: 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
|
||||
|
||||
+5
-23
@@ -1,7 +1,7 @@
|
||||
* Debugging information
|
||||
|
||||
Compile your programs using the `-g' flag in MCS, that will all a special
|
||||
resource containing debugging information to your executable.
|
||||
Compile your programs using the `-g' flag in MCS, that will generate a file
|
||||
with the extension .dbg containing the dwarf symbols for your executable.
|
||||
|
||||
To get stack traces with line number information, you need to run your
|
||||
program like this:
|
||||
@@ -15,27 +15,9 @@
|
||||
|
||||
* Mono Debugger
|
||||
|
||||
The Mono debugger is written in C# and can debug both managed
|
||||
and unmanaged applications, support for multiple-threaded
|
||||
applications and should be relatively easy to port to new
|
||||
platforms.
|
||||
A new debugger has been created in C# and using Gtk# for its
|
||||
user interface, this will simplify the debugging of CLI applications.
|
||||
|
||||
Details of the release are available in <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-January/011415.html">post</a>.
|
||||
|
||||
The debugger contains both Gtk# and command line interfaces.
|
||||
The debugging file format used in Dwarf (its already supported
|
||||
by our class libraries and the Mono C# compiler; To debug C
|
||||
applications, you need a recent GCC, or to pass the -gdwarf-2
|
||||
flag to gcc).
|
||||
|
||||
The debugger is available now, you can get it from <a
|
||||
href="http://primates.ximian.com/~martin/debugger/mono-debugger-0.2.0.tar.gz">here</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Stay turned for its first public release.
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
* A debugging session using a dynamically generated symbol file.
|
||||
|
||||
Let's assume we have the following C# application which we want to debug:
|
||||
|
||||
<pre>
|
||||
using System;
|
||||
|
||||
public class Foo
|
||||
{
|
||||
public struct MyStruct {
|
||||
int a;
|
||||
long b;
|
||||
double c;
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
Int32 value = 5;
|
||||
long test = 512;
|
||||
|
||||
MyStruct my_struct;
|
||||
my_struct.a = 5;
|
||||
my_struct.b = test;
|
||||
my_struct.c = 23323.5235;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
First of all, we need to compile it and create the .il files:
|
||||
|
||||
<pre>
|
||||
$ mcs ./Foo.cs
|
||||
$ monodis /home/export/martin/MONO-LINUX/lib/corlib.dll > corlib.il
|
||||
$ monodis Foo.exe > Foo.il
|
||||
</pre>
|
||||
|
||||
Now we can start the JIT in the debugger:
|
||||
|
||||
<pre>
|
||||
$ gdb ~/monocvs/mono/mono/jit/mono
|
||||
(gdb) r --debug=dwarf --break Foo:Main ./Foo.exe
|
||||
Starting program: /home/martin/monocvs/mono/mono/jit/mono --debug=dwarf --break Foo:Main ./Foo.exe
|
||||
0x081e8911 in ?? ()
|
||||
(gdb) call mono_debug_make_symbols ()
|
||||
(gdb) add-symbol-file /tmp/Foo.o
|
||||
Reading symbols from /tmp/Foo.o...done.
|
||||
Current language: auto; currently c++
|
||||
(gdb) frame
|
||||
#0 Foo.Main () at Foo.il:26
|
||||
26 // method line 2
|
||||
(gdb) n
|
||||
Foo.Main () at Foo.il:38
|
||||
38 IL_0000: ldc.i4.5
|
||||
(gdb) list
|
||||
33 .maxstack 2
|
||||
34 .locals (
|
||||
35 int32 V_0,
|
||||
36 int64 V_1,
|
||||
37 valuetype MyStruct V_2)
|
||||
38 IL_0000: ldc.i4.5
|
||||
39 IL_0001: stloc.0
|
||||
40 IL_0002: ldc.i4 512
|
||||
41 IL_0007: conv.i8
|
||||
42 IL_0008: stloc.1
|
||||
43 IL_0009: ldloca.s 2
|
||||
44 IL_000b: ldc.i4.5
|
||||
45 IL_000c: stfld int32 .MyStruct::a
|
||||
46 IL_0011: ldloca.s 2
|
||||
47 IL_0013: ldloc.1
|
||||
48 IL_0014: stfld int64 .MyStruct::b
|
||||
49 IL_0019: ldloca.s 2
|
||||
50 IL_001b: ldc.r8 23323.5
|
||||
51 IL_0024: stfld float64 .MyStruct::c
|
||||
52 IL_0029: ret
|
||||
(gdb) until 52
|
||||
Foo.Main () at Foo.il:53
|
||||
53 }
|
||||
(gdb) info locals
|
||||
V_0 = 5
|
||||
V_1 = 512
|
||||
V_2 = {a = 5, b = 512, c = 23323.523499999999}
|
||||
</pre>
|
||||
|
||||
As you see in this example, you need to know IL code to use this debugging method - but
|
||||
it may be the only way to debug a library.
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
* A debugging session using a symbol file which has been created by MCS.
|
||||
|
||||
Let's assume we have the following C# application which we want to debug:
|
||||
|
||||
<pre>
|
||||
using System;
|
||||
|
||||
public class Foo
|
||||
{
|
||||
public struct MyStruct {
|
||||
int a;
|
||||
long b;
|
||||
double c;
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
Int32 value = 5;
|
||||
long test = 512;
|
||||
|
||||
MyStruct my_struct;
|
||||
my_struct.a = 5;
|
||||
my_struct.b = test;
|
||||
my_struct.c = 23323.5235;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
First of all, we need to compile it with MCS, assemble the generated .s file and
|
||||
create the .il files for all referenced assemblies which were not compiled with MCS:
|
||||
|
||||
<pre>
|
||||
$ mcs -g ./Foo.cs
|
||||
$ as -o Foo-debug.o Foo-debug.s
|
||||
$ monodis /home/export/martin/MONO-LINUX/lib/corlib.dll > corlib.il
|
||||
</pre>
|
||||
|
||||
Now we can start the JIT in the debugger:
|
||||
|
||||
<pre>
|
||||
$ gdb ~/monocvs/mono/mono/jit/mono
|
||||
(gdb) r --debug=dwarf-plus --break Foo:Main ./Foo.exe
|
||||
Starting program: /home/martin/monocvs/mono/mono/jit/mono --debug=dwarf-plus --break Foo:Main ./Foo.exe
|
||||
Program received signal SIGTRAP, Trace/breakpoint trap.
|
||||
0x081e8681 in ?? ()
|
||||
(gdb) call mono_debug_make_symbols ()
|
||||
(gdb) add-symbol-file Foo-debug.o
|
||||
(gdb) add-symbol-file /tmp/corlib.o
|
||||
` (gdb) frame
|
||||
#0 Main () at ./Foo.cs:11
|
||||
11 public static void Main ()
|
||||
(gdb) n
|
||||
Main () at ./Foo.cs:13
|
||||
13 Int32 value = 5;
|
||||
(gdb)
|
||||
14 long test = 512;
|
||||
(gdb)
|
||||
17 my_struct.a = 5;
|
||||
(gdb)
|
||||
18 my_struct.b = test;
|
||||
(gdb)
|
||||
19 my_struct.c = 23323.5235;
|
||||
(gdb)
|
||||
20 }
|
||||
(gdb) info locals
|
||||
value = 5
|
||||
test = 512
|
||||
my_struct = { a = 5, b = 512, c = 23323.5235 }
|
||||
</pre>
|
||||
|
||||
+3
-7
@@ -37,14 +37,10 @@
|
||||
|
||||
There is a very interesting project to make a JavaVM for .NET
|
||||
<a href="http://radio.weblogs.com/0109845/">here</a>.
|
||||
Currently this will not work with Mono, as they use some
|
||||
pieces of Managed C++ to implement the JNI interface.
|
||||
|
||||
Zoltan has got IKVM to work with Mono.
|
||||
|
||||
<a name="PHP">
|
||||
** PHP
|
||||
|
||||
Sterling has code to allow PHP developers to use Mono code, in
|
||||
his <a href="http://www.php.net/~sterling/mono/">site</a>
|
||||
A workaround has been discussed, contact the author if you want to contribute.
|
||||
|
||||
<a name="MonoLogo">
|
||||
** MonoLogo
|
||||
|
||||
@@ -80,16 +80,6 @@
|
||||
Used to discuss the Windows.Forms implementatation for Mono using Wine.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b><a
|
||||
href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">gtk-sharp-list</a></b>
|
||||
</td>
|
||||
<td>
|
||||
Used to discuss the Gtk bindings for Mono (<a href="http://gtk-sharp.sf.net">Gtk#</a>).
|
||||
</td>
|
||||
</tr>
|
||||
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
|
||||
</table>
|
||||
|
||||
Other mailing lists of interest:
|
||||
@@ -102,11 +92,6 @@ http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
* Alternative archive site
|
||||
|
||||
An alternate site that archives Mono List is available <a
|
||||
href="http://archive.neotonic.com/archive/mono-list">http://archive.neotonic.com/archive/mono-list</a>
|
||||
|
||||
* Google search of the archives
|
||||
|
||||
<!-- Google Search with mods -->
|
||||
|
||||
+2
-14
@@ -155,20 +155,8 @@ export PKG_CONFIG_PATH
|
||||
# /usr/local/include and /usr/local/lib to CPPFLAGS and LDFLAGS. We could
|
||||
# skip this if it would add /usr/include and /usr/lib, but leaving it
|
||||
# shouldnt break anything.
|
||||
iconvdirs="/usr/include /usr/local/include"
|
||||
for i in $iconvdirs
|
||||
do
|
||||
if [ -f $i/iconv.h ]; then
|
||||
iconvh_dir=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$iconvh_dir" ]; then
|
||||
echo "Can't find iconv headers (looked in $iconvdirs)"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
iconvh=`locate include/iconv.h`
|
||||
iconvh_dir=`dirname $iconvh`
|
||||
iconvlib_dir=`echo $iconvh_dir | sed -e 's/include/lib/'`
|
||||
|
||||
echo "Adding $iconvh_dir to CPPFLAGS"
|
||||
|
||||
@@ -1,329 +1,66 @@
|
||||
* MySQL Data Provider
|
||||
|
||||
<p>There are two ADO.NET providers in Mono
|
||||
for a <a href="http://www.mysql.com/">MySQL</a> database:
|
||||
|
||||
<ul>
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">ByteFX.Data.MySQLClient</a>
|
||||
<ul>
|
||||
<li>Written in 100% C#</li>
|
||||
<li>Does not require a client library</li>
|
||||
<li>Works on Mono and Microsoft .NET</li>
|
||||
<li>Requires at least Mono 0.18 and MySQLNet 0.65 for it to work on Mono</li>
|
||||
<li>Works in the SQL# command-line and GTK# GUI version</li>
|
||||
</ul>
|
||||
</li>
|
||||
<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>Mono.Data.MySql (deprecated)
|
||||
<ul>
|
||||
<li>Deprecated in favor of ByteFX.Data.MySQLClient
|
||||
|
||||
<li>Written in C# and uses
|
||||
the MySQL C Client Library</li>
|
||||
|
||||
<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>
|
||||
<li>Works on Windows and Linux via the MySQL client shared library
|
||||
(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>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p><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>
|
||||
|
||||
<p>Testing for Mono's Mono.Data.MySql and ByteFX's ByteFX.Data.MySQLClient is below.
|
||||
<li>Started by Daniel Morgan using C# Bindings to MySQL from Brad Meril.
|
||||
|
||||
** Current Status
|
||||
<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>Other projects which have created a .NET Data provider for MySQL in C#
|
||||
<ul>
|
||||
<li><a href="http://sourceforge.net/projects/mysqldrivercs/">MySQLDriverCS</a> is a MySQL provider written in C#
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a MySQL Manager provider written in C#
|
||||
|
||||
Current Status of the MySQL providers:
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
|
||||
<ul>
|
||||
|
||||
<li>ByteFX.Data.MySQLClient
|
||||
<ul>
|
||||
<li>Build and Runs on Microsoft .NET and Mono</li>
|
||||
<li>Works with SQL# (command-line and GTK# GUI versions)</li>
|
||||
<li>MySQLCommandBuilder now implemented</li>
|
||||
<li>Transaction support now implemented (not all table types support this)</li>
|
||||
<li>GetSchemaTable fixed to not use xsd (for Mono)</li>
|
||||
<li>Driver is now Mono-compatible</li>
|
||||
<li>TIME data type now supported</li>
|
||||
<li>More work to improve Timestamp data type handling</li>
|
||||
<li>Changed signatures of all classes to match corresponding SqlClient classes</li>
|
||||
<li>Protocol compression using <a href="http://www.icsharpcode.net/OpenSource/SharpZipLib/default.asp">SharpZipLib</a></li>
|
||||
<li>Named pipes on Windows now working properly</li>
|
||||
<li>Work done to improve Timestamp data type handling</li>
|
||||
<li>Implemented IEnumerable on DataReader so DataGrid would work</li>
|
||||
<li>Speed increased dramatically by removing bugging network sync code</li>
|
||||
<li>Driver no longer buffers rows of data (more ADO.Net compliant)</li>
|
||||
<li>Conversion bugs related to TIMESTAMP and DATETIME fields fixed</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li>can connect
|
||||
|
||||
<li>Mono.Data.MySql (deprecated)
|
||||
<ul>
|
||||
<li>Currently, only works with version 3.23.x of MySQL</li>
|
||||
<li>can execute non-queries via ExecuteNonQuery()
|
||||
|
||||
<li>can execute aggregates via ExecuteScalar() and retrieve the
|
||||
single row/single column result
|
||||
|
||||
<li>can execute queries and retrieve results using a data reader.
|
||||
|
||||
<li>a schema DataTable has been partially
|
||||
implemented which is returned from GetSchemaTable() in MySqlDataReader.
|
||||
|
||||
<li>a DataTable in a DataSet can be filled via a MySqlDataAdapter
|
||||
|
||||
<li>can connect</li>
|
||||
<li>The shared client libraries
|
||||
between windows version and linux are different: windows has libmySQL.dll
|
||||
while linux has libmysqlclient.so. This is handled by the
|
||||
file etc/mono/config which is mapped by the mono runtime in knowing
|
||||
which native shared library to load. In cvs, this file is mono/config.in and
|
||||
can be modified with a text editor.
|
||||
</ul>
|
||||
|
||||
* Action plan
|
||||
|
||||
The current plan to work on the MySQL data provider:
|
||||
|
||||
<li>can execute non-queries via ExecuteNonQuery()</li>
|
||||
|
||||
<li>can execute aggregates via ExecuteScalar() and retrieve the
|
||||
single row/single column result</li>
|
||||
|
||||
<li>can execute queries and retrieve results using a data reader.</li>
|
||||
|
||||
<li>a schema DataTable has been partially
|
||||
implemented which is returned from GetSchemaTable() in MySqlDataReader.</li>
|
||||
|
||||
<li>a DataTable in a DataSet can be filled via a MySqlDataAdapter</li>
|
||||
<ul>
|
||||
<li>Parameters support via MySqlParameter and MySqlParameterCollection
|
||||
|
||||
<li>The shared client libraries
|
||||
between windows version and linux are different: windows has libmySQL.dll
|
||||
while linux has libmysqlclient.so. This is handled by the
|
||||
file etc/mono/config which is mapped by the mono runtime in knowing
|
||||
which native shared library to load. In cvs, this file is mono/config.in and
|
||||
can be modified with a text editor.</li>
|
||||
|
||||
<li>Works in the SQL# command-line and GTK# GUI version</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Action plan
|
||||
|
||||
The current plan for the MySQL data providers:
|
||||
|
||||
<ul>
|
||||
<li>ByteFX.Data.MySQLClient
|
||||
<ul>
|
||||
<li>Testing and fixes</li>
|
||||
<li>Implement missing features</li>
|
||||
<li>Only fixes for bugs to build and run MySQLClient on Mono
|
||||
will be accepted in mono-cvs. Most bugs and any new features will
|
||||
go into sourceforge cvs. Anytime there is a release of MySQLClient,
|
||||
the source code will be copied from sourceforge cvs to mono-cvs</li>
|
||||
<li>Releases of MySQLClient are determined by Reggie Burnett and releases
|
||||
of Mono are determined by Miguel de Icaza</li>
|
||||
<li>Implement any missing features or fix any bugs in Mono to get new
|
||||
features all of MySQLClient to work on Mono</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Mono.Data.MySql (deprecated)
|
||||
<ul>
|
||||
<li>Testing and bug fixes</li>
|
||||
<li>Mono.Data.MySql is deprecated and therefore maybe removed
|
||||
at a later date. It will stay in Mono for now because other
|
||||
programs maybe using it now.</li>
|
||||
</ul>
|
||||
</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=myuserid;" +
|
||||
"Password=mypassword;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new MySQLConnection(connectionString);
|
||||
dbcon.Open();
|
||||
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.CommandText = 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>
|
||||
<li>Support LOBs (Large Object)
|
||||
|
||||
<li>Change the MySQL provider to not be dependent on a client library and
|
||||
be written in 100% C#
|
||||
|
||||
<li>Connection pooling
|
||||
|
||||
<li>Get the provider to work like other data providers
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</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>On Linux, you may need to make a symbolic link from libmySQL.dll to libmysqlclient.dll</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=myuserid;" +
|
||||
"Password=mypassword;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new MySqlConnection(connectionString);
|
||||
dbcon.Open();
|
||||
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.CommandText = 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>
|
||||
@@ -1,218 +1,52 @@
|
||||
* ODBC Data Provider
|
||||
|
||||
<ul>
|
||||
<li>Exists in namespace System.Data.Odbc and assembly System.Data
|
||||
|
||||
<li>Works on Windows and Linux
|
||||
|
||||
<li>Works on Windows via the native Windows odbc32.dll
|
||||
|
||||
<li>Works on Linux via <a href="http://www.unixodbc.org/">unixODBC</a>
|
||||
|
||||
<li>List of unixODBC <a href="http://www.unixodbc.org/drivers.html">drivers</a> and
|
||||
an alternative list
|
||||
|
||||
<li>An alternative to unixODBC, but not tested with this
|
||||
provider is <a href="http://www.iodbc.org">iODBC</a>
|
||||
|
||||
<li>ADO.NET Data Provider for Data Sources
|
||||
that have <a href="http://www.microsoft.com/data/odbc/">ODBC</a> support.</li>
|
||||
|
||||
<li>Exists in namespace System.Data.Odbc and assembly System.Data</li>
|
||||
|
||||
<li>Works on Windows and Linux. Should have no problems working on UNIX too.</li>
|
||||
|
||||
<li>Works on Windows via the native Windows odbc32.dll</li>
|
||||
|
||||
<li>Works on Linux via:
|
||||
|
||||
<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
|
||||
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>
|
||||
<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>
|
||||
<li><a href="http://www.postgresql.org/">PostgreSQL</a></li>
|
||||
<li><a href="http://www.oracle.com/">Oracle</a></li>
|
||||
<li><a href="http://www.borland.com/products/downloads/download_interbase.html">Interbase</a></li>
|
||||
<li><a href="http://www.sybase.com/downloads">Sybase</a> (
|
||||
via <a href="http://www.freetds.org/">FreeTDS</a> on UNIX)</li>
|
||||
<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>
|
||||
<li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a></li>
|
||||
<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)</li>
|
||||
</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>
|
||||
|
||||
<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>Works in SQL#, but Column names don't show up correctly.</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
retrieve results using an OdbcDataReader.
|
||||
|
||||
<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 with IBM DB2 Universal Database
|
||||
|
||||
<ul>
|
||||
<li>You need a working mono and mcs</li>
|
||||
|
||||
<li>For Unix, you will need unixODBC or iODBC installed</li>
|
||||
|
||||
<li>Have acess to a <a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a> or
|
||||
you can download from IBM</li>
|
||||
|
||||
<li>Read these web pages about Unix, ODBC, and IBM DB2
|
||||
|
||||
<ul>
|
||||
<li><a href="http://www.unixodbc.com/doc/db2.html">unixODBC web page about IBM DB2</a></li>
|
||||
<li><a href="http://www-3.ibm.com/software/data/db2/udb/ad/v8/cli/t0010406">IBM web page about unixODBC and DB2</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>The ODBC provider is similar to the <a href="http://www.go-mono.com/ibmdb2.html">IBM DB2</a> provider.</li>
|
||||
</ul>
|
||||
|
||||
** Testing ODBC provider with MySQL
|
||||
|
||||
<p>You can 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=myuserid;PWD=mypassword"
|
||||
</pre>
|
||||
</li>
|
||||
<li>Here is a ConnectionString format if you do not have a DSN (have not
|
||||
gotten this to work though):
|
||||
<pre>
|
||||
"DRIVER={MySQL ODBC 3.51 Driver};" +
|
||||
"SERVER=localhost;DATABASE=test;" +
|
||||
"UID=myuserid;PASSWORD=mypassword;" +
|
||||
"OPTION=3";
|
||||
|
||||
</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=myuserid;" +
|
||||
"PWD=mypassword";
|
||||
IDbConnection dbcon;
|
||||
dbcon.Open();
|
||||
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.CommandText = 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>
|
||||
@@ -1,153 +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>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</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=test;" +
|
||||
"User ID=postgres;" +
|
||||
"Password=fun2db";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new OleDbConnection(connectionString);
|
||||
dbcon.Open();
|
||||
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.CommandText = 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>
|
||||
|
||||
+29
-161
@@ -1,184 +1,52 @@
|
||||
* Oracle Data Provider
|
||||
|
||||
<ul>
|
||||
|
||||
<li>ADO.NET Data Provider for <a href="http://www.oracle.com/">Oracle</a> databases</li>
|
||||
|
||||
<li>Exists in namespace System.Data.OracleClient and assembly System.Data.OracleClient</li>
|
||||
|
||||
<li>Works on Windows and Linux</li>
|
||||
|
||||
<li>Works with Oracle 8i</li>
|
||||
|
||||
<li>Untested, but should work with Oracle 9i</li>
|
||||
|
||||
<li>Uses the Oracle CLI (Call Level Interface) which is a C library (API) for the Oracle Client
|
||||
software</li>
|
||||
|
||||
<li>Internally, the OracleClient provider has OCI abstracted to an object-oriented programming model</li>
|
||||
|
||||
<li>Created by Daniel Morgan and Tim Coleman</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
<li>Works on Windows</li>
|
||||
|
||||
<li>Works with Oracle 8i</li>
|
||||
|
||||
<li>More information about Oracle can be found at <a href="http://www.oracle.com/"/>here</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Current Status
|
||||
* Current Status
|
||||
|
||||
<ul>
|
||||
<li>OracleConnection can connect and disconnect to an Oracle 8i database on
|
||||
Windows and Linux via OCI (Oracle Call-level Interface)</li>
|
||||
<li>OracleConnection can connect to an Oracle 8i database on
|
||||
Windows via oci.dll</li>
|
||||
|
||||
<li>No longer uses a glue library (a library between the System.Data.OracleClient.dll
|
||||
assembly and the oci library). In Current Mono cvs, System.Data.OracleClient
|
||||
directly platform invokes into the oci library thanks to Tim Coleman.</li>
|
||||
|
||||
<li>Can have multiple connections with different transactions where each transaction is
|
||||
separated from the others, so a rollback or commit in one transaction
|
||||
does not affect the other.</li>
|
||||
<li>The native glue library only has makefiles for Borland C++ and
|
||||
Microsoft Visual C++ command line compilers. Only the makefile for
|
||||
Microsoft Visual C++ command-line compiler has been tested.</li>
|
||||
|
||||
<li>Can execute simple DML SQL statements, such as,
|
||||
INSERT a row into the EMP table via the OracleCommand's ExecuteNonQuery method</li>
|
||||
|
||||
|
||||
<li>The System.Data.OracleClient.dll assembly can be built with mcs/mono via
|
||||
the makefile.gnu for System.Data.OracleClient or csc/.net via the
|
||||
System.Data.OracleClient.build nant build file.</li>
|
||||
|
||||
<li>Can retrieve data via ExecuteReader and OracleDataReader. Currently,
|
||||
supports character, numeric, some date data types. ExecuteScalar
|
||||
also works.</li>
|
||||
|
||||
<li>Simple input parameters (character and numeric data) can now
|
||||
be used in SQL queries. Output parameters do not yet work.</li>
|
||||
|
||||
<li>OracleException and Error handling exists now.</li>
|
||||
|
||||
<li>Message handling needs to be added for non-critical messages
|
||||
received from Oracle</li>
|
||||
|
||||
<li>Handling of various data types need to be added.</li>
|
||||
|
||||
<li>Data Adapter exists, and a DataSet can be filled using it. The
|
||||
Data Adapter is abstract enough that it should work as expected.</li>
|
||||
|
||||
<li>Lots of missing functionality and bugs.</li>
|
||||
|
||||
<li>Works with SQL# command-line and GTK# versions in cvs. Only works with
|
||||
simple character data though. SQL# For GTK# can only show the results to
|
||||
the TextView because the Data Adapter is not yet available</li>
|
||||
System.Data.OracleClient.build nant build file. There is also a Visual Studio.NET
|
||||
solution it too.
|
||||
|
||||
</ul>
|
||||
|
||||
** Action Plan
|
||||
* Action Plan
|
||||
|
||||
<ul>
|
||||
<li>Be able to retrieve results via a data reader (WORKING)</li>
|
||||
<li>Parameters support (IN PROGRESS)</li>
|
||||
<li>transactions (WORKING)</li>
|
||||
<li>Get the makefile for the Borland C++ compiler to work
|
||||
since the <a href="http://www.borland.com/">Borland</a> C++ compiler is
|
||||
a free download</li>
|
||||
<li>Get the native glue lib System.Data.OracleClient.ocigule.dll to be built
|
||||
using gcc on Linux. This would require that Oracle 8i client software be installed
|
||||
on Linux with the oci headers and shared libraries</li>
|
||||
<li>Be able to retrieve results via a data reader</li>
|
||||
<li>Parameters support</li>
|
||||
<li>Stored Procedures, Functions, and Packages support</li>
|
||||
<li>Be able to fill a DataTable in a DataSet via a data adapter (IN PROGRESS)</li>
|
||||
<li>Support for Oracle 8i and 9i (UNKNOWN)</li>
|
||||
<li>Support LOBs</li>
|
||||
<li>Support all the data types</li>
|
||||
<li>Implement Connection pooling</li>
|
||||
<li>Security</li>
|
||||
<li>Be able to fill a DataTable in a DataSet via a data adapter</li>
|
||||
<li>Support for Oracle 9i</li>
|
||||
<li>Figure out how to move the unmanaged OCI handling code in
|
||||
the oci glue C library to the managed C# assembly. I have been unable
|
||||
to successfully connect to an Oracle 8i database by using Platform Invoke and
|
||||
Marshalling in C# to the oci shared library (oci.dll on Windows)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Testing System.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>. If you are connecting
|
||||
remotely to an Oracle database, you need the Oracle client software.
|
||||
Registration to the <a href="http://technet.oracle.com/">Oracle Technology Network</a> 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 System.Data.OracleClient.dll assembly is built, if not, go
|
||||
into System.Data.OracleClient and do a make -f makefile.gnu (on Linux) or
|
||||
../../nant/NAnt.exe (on Windows using Cygwin).</li>
|
||||
|
||||
<li>Take a look at TestOracleClient.cs found at mcs/class/System.Data.OracleClient/Test</li>
|
||||
|
||||
<li>The Data Source is an Oracle TNSNAME</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);
|
||||
dbcon.Open ();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand ();
|
||||
string sql = "SELECT ename, job FROM scott.emp";
|
||||
dbcmd.CommandText = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader ();
|
||||
while (reader.Read ()) {
|
||||
string employeeName = reader["ename"];
|
||||
string job = reader["job"];
|
||||
Console.WriteLine ("Employee Name: {0} Job: {1}",
|
||||
employeeName, job);
|
||||
}
|
||||
// clean up
|
||||
reader.Close ();
|
||||
reader = null;
|
||||
dbcmd.CommandText = 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>
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
* International sites
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="http://mono.es.gnome.org">Mono
|
||||
Hispano</a>: The spanish-speaking community of Mono
|
||||
developers and users. They have quite a number of
|
||||
unique documents and tutorials.
|
||||
|
||||
<li><a href="http://www.go-mono.pl">Mono Poland</a>:
|
||||
Mono site for polish users.
|
||||
|
||||
</ul>
|
||||
|
||||
* User sites
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Alp Toker's <a
|
||||
href="http://www.atoker.com/mono/">site</a>: He is an
|
||||
active Mono developer (gsirc, platano) and produces
|
||||
very nice Debian packages of Mono.
|
||||
|
||||
<li>Brian Ritchie's <a
|
||||
href="http://www12.brinkster.com/brianr/">site</a>:
|
||||
Brian is a contributor to Mono's class library (ODBC
|
||||
provider and the database multiplexing assembly), and
|
||||
has built an application server for .NET and Mono.
|
||||
His site contains news, software, as well as his
|
||||
weblog.
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
+231
-297
@@ -1,187 +1,81 @@
|
||||
* PostgreSQL Data Provider
|
||||
|
||||
There are two ADO.NET data providers for <a href="http://www.postgresql.org/">PostgreSQL</a> in Mono:
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a>
|
||||
<ul>
|
||||
<li>a .NET Managed Data Provider for PostgreSQL
|
||||
|
||||
<li>Written in 100% C#</li>
|
||||
|
||||
<li>does not require a client library</li>
|
||||
|
||||
<li>works on Mono and Microsoft .NET</li>
|
||||
|
||||
<li>created by Francisco Figueiredo jr. and has many developers working on it
|
||||
|
||||
<li>works in the SQL# (command-line and GTK# GUI versions)</li>
|
||||
|
||||
<li>in namespace Npgsql and assembly Npgsql and is found in mcs
|
||||
at mcs/class/Npgsql</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Exists in namespace Mono.Data.PostgreSql and assembly Mono.Data.PostgreSql
|
||||
|
||||
<li>Mono.Data.PostgreSQL (deprecated)
|
||||
<ul>
|
||||
<li>Deprecated in favor of Npgsql</li>
|
||||
|
||||
<li>Exists in namespace Mono.Data.PostgreSql and assembly Mono.Data.PostgreSql</li>
|
||||
<li>Is a Mono Data Provider for the <a href="http://www.postgresql.org/">PostgreSQL</a>
|
||||
client/server database management system.
|
||||
|
||||
<li>Is a Mono Data Provider for the <a href="http://www.postgresql.org/">PostgreSQL</a>
|
||||
client/server database management system.</li>
|
||||
|
||||
<li>Written in C# and has C# bindings to the PostgreSQL C Client library pq.dll on Windows
|
||||
and libpq.so on Linux.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
|
||||
<li>Written in C# and has C# bindings to the PostgreSQL C Client library pq.dll on Windows
|
||||
and libpq.so on Linux.
|
||||
</ul>
|
||||
|
||||
Below, see separate Testing sections for Npgsql and Mono.Data.PostgreSqlClient.
|
||||
|
||||
** Current Status
|
||||
* Current Status
|
||||
|
||||
<ul>
|
||||
<li>Npgsql
|
||||
<ul>
|
||||
<li>Builds and Runs on both Microsoft .NET and Mono.</li>
|
||||
<li>Works using SQL# (command-line and GTK# versions)</li>
|
||||
<li>You can send insert, update, delete queries
|
||||
through NpgsqlCommand.ExecuteNonQuery() method.</li>
|
||||
<li>You can send queries like, select count(*) from table, select version()
|
||||
with NpgsqlCommand.ExecuteScalar() method.</li>
|
||||
<li>There is logging support. (Thanks Dave Page)
|
||||
To use it, place code like that in your program:</li>
|
||||
|
||||
<pre>
|
||||
// Enable logging.
|
||||
NpgsqlEventLog.Level = LogLevel.Debug; // LogLevel.
|
||||
NpgsqlEventLog.LogName = "NpgsqlTests.LogFile"; // LogFile.
|
||||
</pre>
|
||||
|
||||
<li>You can use Npgsql with Mono (Thanks Kristis Makris). It is not working perfectly.</li>
|
||||
<li>There is a winforms test suite (Thanks Dave Page).</li>
|
||||
<li>Clearer code in NpgsqlConnection removing *magic* numbers and constants. (Thanks Kristis Makris)</li>
|
||||
<li>Better support of ODBC-like ConnectionString in NpgsqlConnection (Thanks Dave Page)</li>
|
||||
<li>Thanks Ulrich Sprick for all discussion and ideas.</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li>Mono.Data.PostgreSQL status
|
||||
<ul>
|
||||
|
||||
<li>Deprecated in favor of Npgsql</li>
|
||||
|
||||
<li>We are able to do simple CREATE TABLE, DROP TABLE, UPDATE, INSERT, and
|
||||
DELETE SQL commands using the ExecuteNonQuery method in PgSqlCommand.</li>
|
||||
DELETE SQL commands using the ExecuteNonQuery method in PgSqlCommand.
|
||||
|
||||
<li>We can execute multiple queries and do a NextResult() in PgSqlDataReader()
|
||||
to get the next result set.</li>
|
||||
to get the next result set.
|
||||
|
||||
<li>We are also able to do simple aggregate functions,
|
||||
ie, count(), sum(), min(), and max()
|
||||
in a simple SELECT SQL query using the ExecuteScalar() now.</li>
|
||||
in a simple SELECT SQL query using the ExecuteScalar() now.
|
||||
|
||||
<li>We are also able to retrieve data with a simple SELECT SQL query
|
||||
using ExecuteReader() which returns a PgSqlDataReader. We are able to
|
||||
use GetSchemaTable() to get the meta data about the table columns.
|
||||
We are able to Read() to get each row from the result set.</li>
|
||||
We are able to Read() to get each row from the result set.
|
||||
|
||||
<li>We are able to get
|
||||
String data (char, character, text, varchar), Int16 (smallint),
|
||||
Int32 (integer), Int64 (bigint), DateTime (time, date, timestamp),
|
||||
Boolean (boolean), Single (float), and Double (double).
|
||||
More data types will come later. Note, the types that do work still
|
||||
need thorough testing.</li>
|
||||
need thorough testing.
|
||||
|
||||
<li>Rows that are returned which contain columns that are NULL are handled now.
|
||||
The PgSqlDataReader method IsDBNull() needs to be called to determine
|
||||
if a field IS NULL before trying to read data from that field.</li>
|
||||
if a field IS NULL before trying to read data from that field.
|
||||
|
||||
<li>Calling PostgreSQL stored procedures works. It does not work perfectly.
|
||||
It may not
|
||||
even work to specification - yet. If you want to test it yourself, look at
|
||||
TestSqlDataReader.cs or PostgresTest.cs in
|
||||
mcs/class/System.Data/Test.</li>
|
||||
mcs/class/System.Data/Test.
|
||||
|
||||
<li>Below, I have some sample code you can
|
||||
use to call a PostgreSQL stored procedure named "version". This stored
|
||||
procedure returns a string containing the PostgreSQL server version. Notice
|
||||
the CommandType is StoredProcedure and the method ExecuteScalar() is called.</li>
|
||||
the CommandType is StoredProcedure and the method ExecuteScalar() is called.
|
||||
|
||||
<li>ExecuteScalar() is a lightweight method in class PgSqlCommand that only returns
|
||||
one row and one column as one object - even if there is more than row or column.</li>
|
||||
one row and one column as one object - even if there is more than row or column.
|
||||
|
||||
<li>We have the beginnings of Parameters support PostgreSQL. Only
|
||||
Input Parameters are currently supported. Output, Input/Output,
|
||||
and Return parameters still need to be done.</li>
|
||||
and Return parameters still need to be done.
|
||||
|
||||
<li>A lot of functionality in System.Data is missing, but the
|
||||
infrastructure is starting to come together.
|
||||
|
||||
<li>A lot of Exceptions need to be thrown for various exceptions. However,
|
||||
PgSqlException, PgSqlErrorCollection, and PgSqlError have been partially
|
||||
implemented.</li>
|
||||
implemented.
|
||||
|
||||
<li>Tim Coleman and Rodrigo Moya got the beginnings of the
|
||||
PgSqlDataAdapter/DataSet/DataTable/DataRow to work. Currently,
|
||||
the PgSqlDataAdapter can Fill() relational data into a DataTable in a DataSet.
|
||||
See the test mcs/class/System.Data/Test/TestSqlDataAdapter.cs to see it in action.</li>
|
||||
|
||||
<li>Works in the SQL# command-line version
|
||||
and the GTK# version on Linux. It only works in SQL# command-line version
|
||||
on Windows.</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
See the test mcs/class/System.Data/Test/TestSqlDataAdapter.cs to see it in action.
|
||||
</ul>
|
||||
|
||||
** Action Plan
|
||||
<ul>
|
||||
<li>More testing and fixing bugs</li>
|
||||
|
||||
<li>Better error handling</li>
|
||||
|
||||
<li>More Data Types to use</li>
|
||||
|
||||
<li>Any features for Npgsql should be implemented in Npgsql's main cvs repository at
|
||||
gborg.postgresql.org. Most bugs should be fixed in gborg.postgresql.org's cvs.
|
||||
Only bugs neccessary for building and running of Npgsql on Mono can be done in Mono cvs,
|
||||
but once applied they should be sent to Npgsql's mailing list
|
||||
at gborg.postgresql.org for inclusion into cvs there. Whenever there is
|
||||
a release of Npgsql (determined by Francisco Figueiredo jr. or a release
|
||||
of Mono (determined by Miguel de Icaza), then the Npgsql source
|
||||
in gborg.postgresql.org's cvs will be used to update the Npgsql source in
|
||||
Mono's cvs.
|
||||
</li>
|
||||
|
||||
<li>Mono.Data.PostgreSqlClient even though deprecated can still
|
||||
accept bug fixes. This is because other areas, such as, ASP.NET examples
|
||||
may still use this provider.</li>
|
||||
|
||||
<li>Add any missing functionality to Npgsql. If this funtionality works on
|
||||
.NET but not on Mono, implement the missing features or fix the bugs in Mono</li>
|
||||
|
||||
<li>Npgsql has replaced Mono.Data.PostgreSqlClient as the provider of
|
||||
choice to use. However, Mono.Data.PostgreSqlClient will remain in a
|
||||
deprecated state until nobody uses it anymore - then it can be removed</li>
|
||||
|
||||
<li>Implement more of PostgreSQL 7.3 features in Npgsql</li>
|
||||
</ul>
|
||||
|
||||
** Testing 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
|
||||
@@ -200,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>
|
||||
|
||||
@@ -287,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.
|
||||
@@ -381,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:
|
||||
@@ -399,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
|
||||
@@ -417,162 +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);
|
||||
dbcon.Open();
|
||||
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.CommandText = 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.Open();
|
||||
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.CommandText = 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.
|
||||
@@ -1,156 +0,0 @@
|
||||
* Provider Factory
|
||||
|
||||
<p>Brian Ritchie contributed a Provider Factory and Data Tools for Mono ADO.NET<br>
|
||||
which gives us a foundation for abstract data provider access within Mono
|
||||
|
||||
** Here are the deails:
|
||||
|
||||
<ul>
|
||||
<li>The Provider information is seperate from the connection string information.<br>
|
||||
This allows the list of providers to be stored in the machine.config file.</li>
|
||||
<li>Provider and ProviderCollection objects are available to access <br>
|
||||
the list of providers and modify them at runtime.</li>
|
||||
<li>The ProviderFactory object is used to create new connections, commands,<br>
|
||||
dataadapters, parameters, etc.</li>
|
||||
</ul>
|
||||
|
||||
** Overview of the ProviderFactory object model:
|
||||
|
||||
<ul>
|
||||
<li><b>ProviderFactory</b>: used to create new Connections, Commands,<br>
|
||||
DataAdapters, or Commands. All objects are returned using <br>
|
||||
the provider interfaces such as IDbConnection, IDbCommand,<br>
|
||||
IDbDataAdapter, or IDataParamter</li>
|
||||
|
||||
<li><b>DataTools</b>: static methods for doing <br>
|
||||
common tasks like filling a DataSet <br>
|
||||
with the contents of a select statement.</li>
|
||||
|
||||
<li><b>ProviderCollection</b>: list of providers configured <br>
|
||||
in the system. Initially loaded from app.config, but can <br>
|
||||
be modified at run-time.</li>
|
||||
|
||||
<li><b>Provider</b>: represents a given provider (factory) <br>
|
||||
and holds information needed to <br>
|
||||
create the types.</li>
|
||||
|
||||
<li><b>ProviderSectionHandler</b>: works behind the <br>
|
||||
scenes to load the list of <br>
|
||||
providers from the app.config into a ProviderCollection.</li>
|
||||
</ul>
|
||||
|
||||
** C# source code samples for creating a connection:
|
||||
|
||||
<pre>
|
||||
// Create connection using enhanced connection string
|
||||
// The factory attribute specifies which provider
|
||||
// to use. The factory attribute is parsed out, the
|
||||
// object is created, and then the rest of the
|
||||
// connection string is passed into the provider. The
|
||||
// providers are defined in
|
||||
// the app.config (or machine.config).
|
||||
IDbConnection conn;
|
||||
string connectionString =
|
||||
"factory=System.Data.SqlClient;" +
|
||||
"server=speedy;database=pubs;uid=sa";
|
||||
conn = ProviderFactory.CreateConnection(connectionString);
|
||||
|
||||
// Create connection specifying provider
|
||||
// and standard connection string
|
||||
IDbConnection conn;
|
||||
string provider = "System.Data.SqlClient";
|
||||
string connectionString = "server=speedy;database=pubs;uid=sa";
|
||||
conn = ProviderFactory.CreateConnection(provider,connectionString);
|
||||
|
||||
// Create connection using connection string stored
|
||||
// in app.config under <appSettings>
|
||||
IDbConnection conn;
|
||||
string appSetting = "PubsConnStr";
|
||||
conn = ProviderFactory.CreateConnectionFromConfig(appSetting);
|
||||
</pre>
|
||||
|
||||
|
||||
<p>C# Sample for Creating a DataAdapter and filling a DataSet.
|
||||
|
||||
<pre>
|
||||
// Create Connection
|
||||
IDbConnection conn =
|
||||
ProviderFactory.CreateConnectionFromConfig("PubsConnStr");
|
||||
|
||||
// Select command
|
||||
IDbCommand cmd=conn.CreateCommand();
|
||||
cmd.Text="select * from author";
|
||||
|
||||
// Data Adapter
|
||||
DataSet ds=new DataSet();
|
||||
IDbDataAdapter adapter=ProviderFactory.CreateDataAdapter(cmd);
|
||||
adapter.Fill(ds, "Table1");
|
||||
</pre>
|
||||
|
||||
<p>Creating a DataAdapter and filling a DataSet. <br>
|
||||
The super lazy method for people like me.
|
||||
<pre>
|
||||
// Create Connection
|
||||
IDbConnection conn =
|
||||
ProviderFactory.CreateConnectionFromConfig("TdsPubsConnStr");
|
||||
|
||||
// Data Adapter
|
||||
DataSet ds=DataTools.FillDataSet(conn, "select * from author");
|
||||
</pre>
|
||||
|
||||
|
||||
<p>Here's some sample code on displaying a list <br>
|
||||
of configured ADO.NET providers:
|
||||
<pre>
|
||||
Console.WriteLine("Configured Providers:");
|
||||
foreach (Provider p in ProviderFactory.Providers)
|
||||
Console.WriteLine(p.Description);
|
||||
</pre>
|
||||
|
||||
<p>A Super lazy overload to the FillDataSet method (in <br>
|
||||
DataTools.cs) that will fill a dataset in one line of code.
|
||||
|
||||
<pre>
|
||||
DataSet ds=DataTools.FillDataSet("PubsConnStr", "select * from authors");
|
||||
</pre>
|
||||
|
||||
** About Configuration Files
|
||||
|
||||
<p>Information about <a href="http://msdn.microsoft.com/library/en-us/vbcon/html/vboriintroductiontoapplicationsettingstorage.asp?frame=true">app.config</a> files
|
||||
can be found at <a href="http://msdn.microsoft.com/">MSDN</a>.
|
||||
|
||||
<p>See the mcs/class/Mono.Data/app.config for sample configuration file in<br>
|
||||
mcs source. Basically, if your application is named blah.exe, <br>
|
||||
you would create an app.config file named blah.exe.config
|
||||
|
||||
<p>Here's a sample app.config file showing the provider <br>
|
||||
declarations along with sample connection strings:
|
||||
|
||||
<pre>
|
||||
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="mono.data">
|
||||
<section name="providers" type="Mono.Data.ProviderSectionHandler,Mono.Data" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<appSettings>
|
||||
<add key="PubsConnStr" value="factory=System.Data.SqlClient;server=speedy;database=pubs;uid=sa;pwd=" />
|
||||
</appSettings>
|
||||
<mono.data>
|
||||
<providers>
|
||||
<provider name="System.Data.SqlClient" connection="System.Data.SqlClient.SqlConnection" adapter="System.Data.SqlClient.SqlDataAdapter" assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<provider name="System.Data.OleDb" connection="System.Data.OleDb.OleDbConnection" adapter="System.Data.OleDb.OleDbDataAdapter" assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<provider name="System.Data.Odbc" connection="System.Data.Odbc.OdbcConnection" adapter="System.Data.OleDb.OdbcDataAdapter" assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<provider name="Mono.Data.TdsClient" connection="Mono.Data.TdsClient.TdsConnection" adapter="Mono.Data.TdsClient.TdsDataAdapter" assembly="Mono.Data.TdsClient" />
|
||||
<provider name="Mono.Data.MySql" connection="Mono.Data.MySql.MySqlConnection" adapter="Mono.Data.MySql.MySqlDataAdapter" assembly="Mono.Data.MySql" />
|
||||
<provider name="Mono.Data.PostgreSqlClient" connection="Mono.Data.PostgreSqlClient.PgSqlConnection" adapter="Mono.Data.PostgreSqlClient.PgSqlDataAdapter" assembly="Mono.Data.PostgreSqlClient" />
|
||||
<provider name="Mono.Data.SqliteClient" connection="Mono.Data.SqliteClient.SqliteConnection" adapter="Mono.Data.SqliteClient.SqliteDataAdapter" assembly="Mono.Data.SqliteClient" />
|
||||
<provider name="Mono.Data.SybaseClient" connection="Mono.Data.SybaseClient.SybaseConnection" adapter="Mono.Data.SybaseClient.SybaseDataAdapter" assembly="Mono.Data.SybaseClient" />
|
||||
</providers>
|
||||
</mono.data>
|
||||
</configuration>
|
||||
|
||||
</pre>
|
||||
|
||||
-141
@@ -1,141 +0,0 @@
|
||||
* Screenshots
|
||||
|
||||
** Mono Debugger
|
||||
|
||||
Some shots of the <a href="jit-debug.html">Mono Debugger</a>
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="images/Screenshot-Debugger-1.png"><img src="images/Screenshot-Debugger-1-thumb.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Debugger showing the source code view.
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="images/Screenshot-Debugger-2.png"><img src="images/Screenshot-Debugger-2-thumb.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Debugger showing the CPU view.
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** Mono Documentation Browser
|
||||
|
||||
The Mono Documentation Browser is available from <a
|
||||
href="anoncvs.html">CVS</a>, module `monodoc'.
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="images/Screenshot-B2.png"><img src="images/Screenshot-B2-thumb.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Mono Documentation Browser rendering a method description.
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="images/Screenshot-MethodSummary.png"><img src="images/Screenshot-MethodSummary-thumb.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Mono Documentation Browser rendering the class method summary
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** Mono Basic
|
||||
|
||||
The Mono Basic compiler ships with the Mono distribution.
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="images/gtk-vb.png"><img src="images/gtk-vb-thumb.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Mono Basic running a sample Gtk# application.
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** Platano Media Player
|
||||
|
||||
Alp's <a href="http://www.atoker.com/platano/">Platano</a>
|
||||
Media Player is written with Gtk# (with GStreamer support):
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="images/platano_s.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Platano startup.
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="images/platano-playing_s.png">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Platano playing the <a
|
||||
href="http://developer.ximian.com/projects/third_party/codemonkey/index.html">Code
|
||||
Monkey At Work</a> video.
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** GSIRC
|
||||
|
||||
Alp's <a href="http://www.atoker.com/gsirc/">GSIRC</a>
|
||||
Gtk-Sharp IRC written with Gtk#
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://go-mono.com/images/gsirc-0.2a_overview.jpg"><img src="images/gsirc-0.2a_overview-thumb.jpg"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
GSIRC is shown with the preferences dialog and chatting on some channels (rooms).
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** SQL# For GTK#
|
||||
|
||||
Daniel Morgan's SQL query tool that runs on Mono on Linux and Windows. It is
|
||||
written in C# and allows you to connect to various Mono ADO.NET providers and
|
||||
enter SQL commands.
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="http://go-mono.com/images/sqlsharp.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
SQL# For GTK# is shown retrieving data from a Microsoft SQL Server 2000 database.
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** SkyNET
|
||||
|
||||
SkyNET is written in C# and uses GTK# for displaying a star chart.
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="http://go-mono.com/images/skynet.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
+24
-180
@@ -1,214 +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>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>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
<li>Implemented in 100% C#
|
||||
|
||||
<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>Works in the SQL# command-line and GTK# GUI version</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>
|
||||
|
||||
<li>Needs more testing</li>
|
||||
|
||||
<li>Would like to figure out how to connect via Trusted_Connection or Integrated Security</li>
|
||||
|
||||
<li>Start work on TDS Protocol Version 8.0 support</li>
|
||||
<li>Connection timeouts is being developed now.
|
||||
|
||||
<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>If using Microsoft SQL Server 2000, make sure
|
||||
you are using at least Service Pack 3 for Microsoft SQL Server 2000. If using
|
||||
MSDE 2000, make sure you have the special Service Pack 3 for MSDE 2000.</li>
|
||||
|
||||
<li>For those that only have MSDE installed. You can change the authentication mode
|
||||
from Windows Only Authentication to SQL Server and Windows Authentications (also knows as Mixed-mode authentication)
|
||||
via the <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q322336&sd=tech#4">registry</a></li>. It is
|
||||
the LoginMode you need to change. By default,
|
||||
MSDE is installed with Windows Only Authentication. For SqlClient to work with MSDE, you will
|
||||
need to change the setting.</a>
|
||||
|
||||
<li>If using MSDE, you might need to create a new user with password. Give
|
||||
this user access to various databases in this MSDE instance. Also, for each
|
||||
database, give this new user at least SELECT access to the various tables you want
|
||||
to retrieve data from.</li>
|
||||
|
||||
<li>If you have Enterprise Manager, you can easily change the authentication mode
|
||||
for both MSDE and Microsoft SQL Server. To change the authentication mode in
|
||||
Enterprise Mananger, select the instance, right-click on it, and select properites.
|
||||
The SQL Server properties dialog for that instance will pop up. Choose the Security
|
||||
tab. Change the authentication from Windows Only to SQL Server and Windows. If
|
||||
the instance of your database does not show up in Enterprise Manager, Register first
|
||||
by selecting the Action menu and choosing New SQL Server Registration.</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>Mono's SqlClient does not support trusted connections
|
||||
nor integrated security. You can not use this when connecting. You need
|
||||
to explicitly use a User ID and Password
|
||||
authenticated by SQL Server.</li>
|
||||
|
||||
<li>Has a connection string format:
|
||||
<pre>
|
||||
Server=hostname;Database=databaseName;User ID=userid;Password=password
|
||||
</pre>
|
||||
</li>
|
||||
<li>The Server part can be used three ways:
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td><b>Server Definition</b></td> <td><b>Example</b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>hostname</td> <td>Server=MYHOST</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>hostname,port</td> <td>Server=MYHOST,1433</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>hostname\\instance</td> <td>Server=MYHOST\\NETSDK</td>
|
||||
</tr>
|
||||
</table>
|
||||
</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=myuserid;" +
|
||||
"Password=mypassword;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new SqlConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"SELECT fname, lname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = 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>
|
||||
|
||||
+12
-127
@@ -1,143 +1,28 @@
|
||||
* SQL Lite Data Provider
|
||||
|
||||
<ul>
|
||||
<li>ADO.NET Data Provider for
|
||||
the <a href"http://www.hwaci.com/sw/sqlite/">SQL Lite</a> which
|
||||
is an embeddable SQL database engine</li>
|
||||
|
||||
<li>From the SQL Lite web page: SQLite is a C library that
|
||||
implements an embeddable SQL database engine. Programs that link with
|
||||
the SQLite library can have SQL database access without
|
||||
running a separate RDBMS process. The distribution
|
||||
comes with a standalone command-line access program (sqlite) that
|
||||
can be used to administer an SQLite database and which serves
|
||||
as an example of how to use the SQLite library. SQLite is not a client library
|
||||
used to connect to a big database server. SQLite is the server. The SQLite
|
||||
library reads and writes directly to and from the database files on disk.</li>
|
||||
|
||||
<li>SQL Lite can be downloaded
|
||||
from <a href"http://www.hwaci.com/sw/sqlite/download.html">here</a>.
|
||||
binaries exist for Linux and Windows. sqlite.dll on Windows
|
||||
and sqlite.so on Linux. The source code is available too.</li>
|
||||
|
||||
<li>Exists in namespace and assembly Mono.Data.SqliteClient</li>
|
||||
<li>Exists in namespace and assembly Mono.Data.SqliteClient
|
||||
|
||||
<li>Created by Vladimir Vukicevic so he could have a database of
|
||||
thumbnail images for mPhoto. mPhoto is GUI application
|
||||
for cataloging images. mPhoto runs on Mono
|
||||
and uses <a href="http:www.go-mono.com/gtk-sharp.html">GTK#</a> for its GUI.</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</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.
|
||||
</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);
|
||||
dbcon.Open();
|
||||
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.CommandText = 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
-124
@@ -1,155 +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>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</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>
|
||||
|
||||
** 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>Has a connection string format:
|
||||
<pre>
|
||||
Server=hostname;Database=databaseName;User ID=userid;Password=password
|
||||
</pre>
|
||||
</li>
|
||||
<li>The Server part can be used two ways:
|
||||
<ul>
|
||||
<li>hostname - "Server=MYHOST"</li>
|
||||
<li>hostname,port - "Server=MYHOST,1533"</li>
|
||||
</ul>
|
||||
</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=myuserid;" +
|
||||
"Password=mypassword;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new SybaseConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"SELECT fname, lname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = 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
-127
@@ -1,159 +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>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</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>
|
||||
|
||||
** 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>If using Microsoft SQL Server 2000, make sure
|
||||
you are using at least Service Pack 3 for Microsoft SQL Server 2000</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>Has a connection string format:
|
||||
<pre>
|
||||
Server=hostname;Database=databaseName;User ID=userid;Password=password
|
||||
</pre>
|
||||
</li>
|
||||
<li>The Server part can be used two ways:
|
||||
<ul>
|
||||
<li>hostname - "Server=MYHOST"</li>
|
||||
<li>hostname,port - "Server=MYHOST,1533"</li>
|
||||
</ul>
|
||||
</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=myuserid;" +
|
||||
"Password=mypassword;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new TdsConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"SELECT fname, lname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = 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
-7
@@ -1,8 +1,5 @@
|
||||
0,Home,index.html,index.src
|
||||
1,FAQ,faq.html,faq.src
|
||||
1,News archive,http://monoevo.sf.net/mwn/archives.html
|
||||
1,Screenshots,screenshots.html,screenshots.src
|
||||
1,Other sites,other.html,other.src
|
||||
0,Mono,rationale.html,rationale.src
|
||||
1,Runtime,runtime.html,runtime.src
|
||||
2,Embedding,embedded-api.html,embedded-api.src
|
||||
@@ -36,9 +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
|
||||
2,ProviderFactory,provider-factory.html,provider-factory.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
|
||||
@@ -48,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
|
||||
@@ -64,5 +59,4 @@
|
||||
1,EnterpriseServices,class-status-System.EnterpriseServices.html,class-status-System.EnterpriseServices.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Formatters.Soap,class-status-System.Runtime.Serialization.Formatters.Soap.html,class-status-System.Runtime.Serialization.Formatters.Soap.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Cscompmgd,class-status-Cscompmgd.html,class-status-Cscompmgd.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,System.Security,class-status-System.Security.html,class-status-System.Security.src,cm/cormissing.css,cm/cormissing.js
|
||||
0,Contact,contact.html,contact.src
|
||||
+37
-42
@@ -5,7 +5,7 @@ CORCOMPARE=../../../mcs/tools/corcompare
|
||||
|
||||
OBJECTS= \
|
||||
deploy/ado-net.html \
|
||||
deploy/provider-factory.html \
|
||||
deploy/firebird.html \
|
||||
deploy/mysql.html \
|
||||
deploy/odbc.html \
|
||||
deploy/oledb.html \
|
||||
@@ -19,44 +19,6 @@ OBJECTS= \
|
||||
deploy/asp-net.html \
|
||||
deploy/books.html \
|
||||
deploy/contributing.html \
|
||||
deploy/contact.html \
|
||||
deploy/c-sharp.html \
|
||||
deploy/ccvs.html \
|
||||
deploy/documentation.html \
|
||||
deploy/download.html \
|
||||
deploy/crypto.html \
|
||||
deploy/embedded-api.html \
|
||||
deploy/faq.html \
|
||||
deploy/firebird.html \
|
||||
deploy/gcc-frontend.html \
|
||||
deploy/gtk-sharp.html \
|
||||
deploy/hackers.html \
|
||||
deploy/ideas.html \
|
||||
deploy/ibmdb2.html \
|
||||
deploy/index.html \
|
||||
deploy/java.html \
|
||||
deploy/jit-debug.html \
|
||||
deploy/languages.html \
|
||||
deploy/mailing-lists.html \
|
||||
deploy/mbas.html \
|
||||
deploy/mono-beginning.html \
|
||||
deploy/mono-contribution-howto.html \
|
||||
deploy/monodoc-xml.html \
|
||||
deploy/other.html \
|
||||
deploy/papers.html \
|
||||
deploy/passport.html \
|
||||
deploy/plans.html \
|
||||
deploy/porting.html \
|
||||
deploy/ppc.html \
|
||||
deploy/rationale.html \
|
||||
deploy/resources.html \
|
||||
deploy/roadmap.html \
|
||||
deploy/runtime.html \
|
||||
deploy/screenshots.html \
|
||||
deploy/status.html \
|
||||
deploy/testing.html \
|
||||
deploy/tools.html \
|
||||
deploy/winforms.html \
|
||||
deploy/class-status.html \
|
||||
deploy/class-status-corlib.html \
|
||||
deploy/class-status-System.html \
|
||||
@@ -68,12 +30,45 @@ OBJECTS= \
|
||||
deploy/class-status-Microsoft.VisualBasic.html \
|
||||
deploy/class-status-System.EnterpriseServices.html \
|
||||
deploy/class-status-System.Runtime.Serialization.Formatters.Soap.html \
|
||||
deploy/class-status-System.Security.html \
|
||||
deploy/class-status-System.Windows.Forms.html \
|
||||
deploy/class-status-Cscompmgd.html \
|
||||
deploy/class-library.html \
|
||||
deploy/classlib-doc.html
|
||||
|
||||
deploy/classlib-doc.html \
|
||||
deploy/contact.html \
|
||||
deploy/c-sharp.html \
|
||||
deploy/mbas.html \
|
||||
deploy/ccvs.html \
|
||||
deploy/documentation.html \
|
||||
deploy/download.html \
|
||||
deploy/crypto.html \
|
||||
deploy/embedded-api.html \
|
||||
deploy/faq.html \
|
||||
deploy/gcc-frontend.html \
|
||||
deploy/hackers.html \
|
||||
deploy/index.html \
|
||||
deploy/ideas.html \
|
||||
deploy/java.html \
|
||||
deploy/jit-debug.html \
|
||||
deploy/jit-debug-sample.html \
|
||||
deploy/jit-debug-sample2.html \
|
||||
deploy/languages.html \
|
||||
deploy/mailing-lists.html \
|
||||
deploy/mono-beginning.html \
|
||||
deploy/mono-contribution-howto.html \
|
||||
deploy/monodoc-xml.html \
|
||||
deploy/papers.html \
|
||||
deploy/passport.html \
|
||||
deploy/plans.html \
|
||||
deploy/porting.html \
|
||||
deploy/ppc.html \
|
||||
deploy/rationale.html \
|
||||
deploy/resources.html \
|
||||
deploy/roadmap.html \
|
||||
deploy/runtime.html \
|
||||
deploy/status.html \
|
||||
deploy/testing.html \
|
||||
deploy/tools.html \
|
||||
deploy/winforms.html
|
||||
#2,Configuration.Install,class-status-System.Configuration.Install.html,class-status-System.Configuration.Install.src,cm/cormissing.css,cm/cormissing.js
|
||||
#2,Runtime.Remoting,class-status-System.Runtime.Remoting.html,class-status-System.Runtime.Remoting.src,cm/cormissing.css,cm/cormissing.js
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<!--
|
||||
body { font-family: "trebuchet ms", lucida, verdana, helvetica;
|
||||
|
||||
}
|
||||
background-attachment: fixed; }
|
||||
body, td, table { font-family: "trebuchet ms", lucida, verdana, helvetica;
|
||||
font-size: 14px; }
|
||||
|
||||
|
||||
@@ -225,15 +225,6 @@
|
||||
It may not be possible to manage exceptions in that case,
|
||||
though. I need to think more about it.
|
||||
|
||||
** Threading issues
|
||||
|
||||
If your application creates threads on its own, and you want them to
|
||||
be able to call code into the CIL universe with Mono, you have to
|
||||
register the thread with Mono before issuing the call.
|
||||
|
||||
To do so, call the mono_thread_attach() function before you execute
|
||||
any managed code from the thread
|
||||
|
||||
* Samples
|
||||
|
||||
See the sample programs inmono/sample/embed for examples of
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
.\"
|
||||
.\" cert2spc manual page.
|
||||
.\" Copyright 2002, 2003 Motus Technologies
|
||||
.\" Author:
|
||||
.\" Sebastien Pouliot ([email protected])
|
||||
.\"
|
||||
.TH Mono "cert2spc"
|
||||
.SH NAME
|
||||
cert2spc \- Transform multiple X.509 certificates to a Software
|
||||
Publisher Certificate
|
||||
.SH SYNOPSIS
|
||||
.PP
|
||||
.B cert2spc certificate|crl [certificate|crl ...] outputfile.spc
|
||||
.SH DESCRIPTION
|
||||
Combine a list of X.509 certificates or X.509 CRL (Certificate
|
||||
Revocation List) into a Software Publisher Certificate (PKCS#7
|
||||
file). The SPC file is required for signing a PE file (like an
|
||||
assembly) using signcode.
|
||||
.SH PARAMETERS
|
||||
.TP
|
||||
.I "certificate"
|
||||
One (or more) X.509 certificate to add (space separated).
|
||||
.TP
|
||||
.I "crl"
|
||||
One (or more) X.509 CRL to add (space separated).
|
||||
.TP
|
||||
.I "output.spc"
|
||||
Software Publisher Certificate to output. If the specified file
|
||||
exists it will be overwritten.
|
||||
.SH AUTHOR
|
||||
Written by Sebastien Pouliot
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2002, 2003 Motus Technologies.
|
||||
Released under BSD license.
|
||||
.SH MAILING LISTS
|
||||
Visit http://mail.ximian.com/mailman/mono-list for details.
|
||||
.SH WEB SITE
|
||||
Visit: http://www.go-mono.com for details
|
||||
.SH SEE ALSO
|
||||
.BR makecert(1), signcode(1)
|
||||
|
||||
|
||||
@@ -136,11 +136,6 @@ Provides a search path to mono and mint where to look for library files.
|
||||
Directories are separated by the platform path separator (colons on unix). Example:
|
||||
.B /home/username/lib:/usr/local/mono/lib
|
||||
.PP
|
||||
.TP
|
||||
.I "MONO_DISABLE_SHM"
|
||||
If this variable is set, it disables the Windows I/O Emulation layer,
|
||||
and handles (files, events, mutexes, pipes) will not be shared across
|
||||
processes. This option is only available on Unix.
|
||||
.SH FILES
|
||||
On Unix assemblies are loaded from the installation lib directory. If you set
|
||||
`prefix' to /usr, the assemblies will be located in /usr/lib. On
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
.\"
|
||||
.\" secutil manual page.
|
||||
.\" Copyright 2002, 2003 Motus Technologies
|
||||
.\" Author:
|
||||
.\" Sebastien Pouliot ([email protected])
|
||||
.\"
|
||||
.TH Mono "secutil"
|
||||
.SH NAME
|
||||
secutil \- Extract X.509 certificates and strongnames from assemblies.
|
||||
.SH SYNOPSIS
|
||||
.PP
|
||||
.B secutil [options] filename
|
||||
.SH DESCRIPTION
|
||||
Extract X.509 certificates and strongnames from assemblies in a
|
||||
format that can be easily re-used in source code (C# or VB.NET syntax).
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.I "-s assembly", "-strongname assembly"
|
||||
Display strongname informations about the assembly.
|
||||
.TP
|
||||
.I "-x assembly", "-x509certificate assembly"
|
||||
Display the X509 Authenticode certificate for the assembly.
|
||||
.TP
|
||||
.I "-a", "-array"
|
||||
Display data in a decimal array (default).
|
||||
.TP
|
||||
.I "-v", "-vbmode"
|
||||
Display data in a VisualBasic friendly format.
|
||||
.TP
|
||||
.I "-c", "-cmode"
|
||||
Display data in a C/C++/C# friendly format (default).
|
||||
.TP
|
||||
.I "-help", "-h", "-?"
|
||||
Display help about this tool.
|
||||
.SH AUTHOR
|
||||
Written by Sebastien Pouliot
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2002, 2003 Motus Technologies.
|
||||
Released under BSD license.
|
||||
.SH MAILING LISTS
|
||||
Visit http://mail.ximian.com/mailman/mono-list for details.
|
||||
.SH WEB SITE
|
||||
Visit: http://www.go-mono.com for details
|
||||
.SH SEE ALSO
|
||||
.BR sn(1), signcode(1)
|
||||
+11
-47
@@ -342,30 +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 M PostgreSQL Mono.Data.PostgreSqlClient Mono.Data.PostgreSqlClient
|
||||
DB2 IBM DB2 Mono.Data.DB2Client Mono.Data.DB2Client
|
||||
Oracle Oracle 8i System.Data.OracleClient System.Data.OracleClient
|
||||
|
||||
External to Mono
|
||||
----------------
|
||||
|
||||
Npgsql NetPostgreSQL 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
|
||||
@@ -421,32 +407,10 @@ which connects to a PostgreSQL database:
|
||||
|
||||
Provider=PostgreSQL;Addr=127.0.0.1;Database=rodrigo
|
||||
|
||||
|
||||
Oracle via System.Data.OracleClient
|
||||
|
||||
Data Source=testdb;User ID=scott;Password=tiger
|
||||
|
||||
|
||||
IBM DB2 Universal Database via Mono.Data.DB2Client
|
||||
|
||||
DSN=sample;User ID=db2admin;Password=mysecret
|
||||
|
||||
|
||||
Npgsql (.NET PostgreSQL) from
|
||||
http://gborg.postgresql.org/project/npgsql/projdisplay.php
|
||||
|
||||
Server=localhost;Database=test;User ID=postgres;Password=fun2db
|
||||
|
||||
|
||||
MySQLNet (ByteFX MySQL) from
|
||||
http://sourceforge.net/projects/mysqlnet/
|
||||
|
||||
Server=localhost;Database=test;User ID=mysql;Password=
|
||||
|
||||
|
||||
.fi
|
||||
.SH TRACING SUPPORT
|
||||
No support for tracing right now.
|
||||
.SH DEBUGGING SUPPORT
|
||||
No debugging support.
|
||||
.SH AUTHORS
|
||||
The Mono SQL# Tool was written
|
||||
.nf
|
||||
|
||||
@@ -16,4 +16,3 @@ Class Libraries:
|
||||
John Barnette ([email protected])
|
||||
Daniel Morgan <[email protected]>
|
||||
Sebastien Pouliot <[email protected]>
|
||||
Per Arneng <[email protected]>
|
||||
@@ -1,29 +1,3 @@
|
||||
2003-02-16 Martin Baulig <[email protected]>
|
||||
|
||||
* docs/compiler: Added a few works about the new `Location' code.
|
||||
|
||||
2003-02-15 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile.gnu: Add testcorlib target to run just the corlib unit tests.
|
||||
|
||||
2003-02-10 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile: Add testcorlib target to run just the corlib unit tests.
|
||||
|
||||
2003-01-16 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile.gnu: Add corlib target to just build that.
|
||||
|
||||
2003-01-14 Duncan Mak <[email protected]>
|
||||
|
||||
* ilasm/parser/ScannerAdapter.cs: Remove the cleanup method now that
|
||||
it's no longer in the interface.
|
||||
|
||||
2003-01-13 Duncan Mak <[email protected]>
|
||||
|
||||
* ilasm/parser/ScannerAdapter.cs: Implement the new cleanup method
|
||||
in the tokenizer. This fixes the build.
|
||||
|
||||
2003-01-10 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* README.building: New file.
|
||||
|
||||
@@ -1,39 +1,3 @@
|
||||
2003-02-22 Martin Baulig <[email protected]>
|
||||
|
||||
* library.make: Pass `MCS_FLAGS' to MCS.
|
||||
|
||||
2003-02-15 Zoltan Varga <[email protected]>
|
||||
|
||||
* makefile.gnu (test): do not install .dbg files since mcs no longer
|
||||
generates them.
|
||||
|
||||
2003-02-13 Tim Coleman <[email protected]>
|
||||
* makefile.gnu: Add System.Data.OracleClient to linux build.
|
||||
|
||||
2003-02-10 Nick Drochak <[email protected]>
|
||||
|
||||
* library.build:
|
||||
* makefile: add testcorlib target to run unit tests just for corlib.
|
||||
|
||||
2003-02-05 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* library.build: added Mono.Security.Win32 to build, test and
|
||||
clean. There's no makefile.gnu for this assembly as it is
|
||||
specific to Win32.
|
||||
|
||||
2003-01-23 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile: install the .dbg files too so the debugger can use them.
|
||||
|
||||
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
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2003-02-23 Jackson Harper <[email protected]>
|
||||
|
||||
* CompilerError.cs: Use fields not properties, and remove unneeded finalizer
|
||||
|
||||
2002-12-15 Jackson Harper <[email protected]>
|
||||
|
||||
* CompilerError.cs ErrorLevel.cs: Moved ErrorLevel enum into its own file
|
||||
|
||||
@@ -13,23 +13,64 @@ namespace Microsoft.CSharp {
|
||||
|
||||
public class CompilerError {
|
||||
|
||||
public ErrorLevel ErrorLevel;
|
||||
public string ErrorMessage;
|
||||
public string SourceFile;
|
||||
public int ErrorNumber;
|
||||
public int SourceColumn;
|
||||
public int SourceLine;
|
||||
private ErrorLevel level = ErrorLevel.None;
|
||||
private string message = null;
|
||||
private string file = null;
|
||||
private int number = 0;
|
||||
private int column = 0;
|
||||
private int line = 0;
|
||||
|
||||
public CompilerError ()
|
||||
public CompilerError()
|
||||
{
|
||||
ErrorLevel = ErrorLevel.None;
|
||||
ErrorMessage = String.Empty;
|
||||
SourceFile = String.Empty;
|
||||
ErrorNumber = 0;
|
||||
SourceColumn = 0;
|
||||
SourceLine = 0;
|
||||
}
|
||||
|
||||
~CompilerError()
|
||||
{
|
||||
message = null;
|
||||
file = null;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Public Properties
|
||||
//
|
||||
|
||||
public ErrorLevel ErrorLevel {
|
||||
get { return level; }
|
||||
set { level = value; }
|
||||
}
|
||||
|
||||
public string ErrorMessage {
|
||||
get {
|
||||
return (null == message ? String.Empty : message);
|
||||
}
|
||||
set {
|
||||
message = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int ErrorNumber {
|
||||
get { return number; }
|
||||
set { number = value; }
|
||||
}
|
||||
|
||||
public int SourceColumn {
|
||||
get { return column; }
|
||||
set { column = value; }
|
||||
}
|
||||
|
||||
public string SourceFile {
|
||||
get {
|
||||
return (null == file ? String.Empty : file);
|
||||
}
|
||||
set { file = value; }
|
||||
}
|
||||
|
||||
public int SourceLine {
|
||||
get { return line; }
|
||||
set { line = value; }
|
||||
}
|
||||
|
||||
//
|
||||
// Public Methods
|
||||
//
|
||||
@@ -51,7 +92,6 @@ namespace Microsoft.CSharp {
|
||||
return builder.ToString ();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Private Properties
|
||||
//
|
||||
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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
-9
@@ -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
-10
@@ -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
|
||||
};
|
||||
}
|
||||
+5
-13
@@ -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
-10
@@ -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
|
||||
};
|
||||
}
|
||||
+1
-3
@@ -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 {
|
||||
|
||||
+80
-98
@@ -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
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+31
-64
@@ -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]
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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
|
||||
};
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
2002-02-19 Carsten Hess
|
||||
* Created
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- NAnt build file for Microsoft.VisualC.dll -->
|
||||
|
||||
<project name="System" default="build">
|
||||
<property name="debug" value="false"/>
|
||||
|
||||
<target name="build">
|
||||
<mkdir dir="../lib"/>
|
||||
<csc target="library" output="../lib/Microsoft.VisualC.dll" debug="${debug}">
|
||||
<arg value="/nowarn:1595"/>
|
||||
<arg value="/noconfig"/> <!-- don't reference ms assemblies -->
|
||||
|
||||
<!-- cor compare dies with these currently -->
|
||||
<!--<arg value="/nostdlib"/>--> <!-- don't reference mscorlib -->
|
||||
<!--<arg value="/lib:../lib/"/>-->
|
||||
<!--<arg value="/r:..\lib\corlib.dll"/>-->
|
||||
<!--<arg value="/r:..\lib\System.dll"/>-->
|
||||
<arg value="/r:System.dll"/>
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
<excludes name="Test/**"/>
|
||||
</sources>
|
||||
<references>
|
||||
<!--<includes name="../lib/corlib.dll"/>-->
|
||||
<!--<includes name="../lib/System.dll"/>-->
|
||||
</references>
|
||||
</csc>
|
||||
<copy file="../lib/Microsoft.VisualC.dll" tofile="Test/Microsoft.VisualC.dll"/>
|
||||
</target>
|
||||
|
||||
<target name="test" depends="build">
|
||||
<nant basedir="Test" target="test"/>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<nant basedir="Test" target="clean"/>
|
||||
<delete file="../lib/Microsoft.VisualC.dll" failonerror="false"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class DebugInfoInPDBAttribute:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class DecoratedNameAttribute:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class IsCXXReferenceModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class IsConstModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class IsLongModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class IsSignedModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class IsVolatileModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
|
||||
public sealed class MiscellaneousBitsAttribute:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class NeedsCopyConstructorModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class NoSignSpecifiedModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
Microsoft.VisualC/DebugInfoInPDBAttribute.cs
|
||||
Microsoft.VisualC/DecoratedNameAttribute.cs
|
||||
Microsoft.VisualC/IsCXXReferenceModifier.cs
|
||||
Microsoft.VisualC/IsConstModifier.cs
|
||||
Microsoft.VisualC/IsLongModifier.cs
|
||||
Microsoft.VisualC/IsSignedModifier.cs
|
||||
Microsoft.VisualC/IsVolatileModifier.cs
|
||||
Microsoft.VisualC/MiscellaneousBitsAttribute.cs
|
||||
Microsoft.VisualC/NeedsCopyConstructorModifier.cs
|
||||
Microsoft.VisualC/NoSignSpecifiedModifier.cs
|
||||
@@ -1,13 +0,0 @@
|
||||
topdir = ../..
|
||||
|
||||
LIBRARY = $(topdir)/class/lib/Microsoft.VisualC.dll
|
||||
|
||||
LIB_LIST = list
|
||||
LIB_FLAGS = -r corlib -r System
|
||||
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=./Test*
|
||||
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include $(topdir)/class/library.make
|
||||
@@ -1,119 +1,3 @@
|
||||
2003-02-22 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Incremented version number.
|
||||
|
||||
2003-02-22 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (MonoSymbolFile.FindMethod): Fixed a bug.
|
||||
(MonoSymbolFile.MethodLookup): New method.
|
||||
|
||||
2003-02-18 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (MonoSymbolFile.GetMethod): Added overloaded
|
||||
version which takes a MethodBase.
|
||||
|
||||
2003-02-18 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs (MethodIndexEntry): New public struct.
|
||||
|
||||
* MonoSymbolFile.cs (MonoSymbolFile.GetMethodByToken): New method.
|
||||
|
||||
2003-02-18 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (MonoSymbolFile.Assembly): New public property.
|
||||
|
||||
* MonoSymbolTable.cs (MethodEntry.MethodBase): New public property.
|
||||
(MethodEntry.LocalTypes): New public variable.
|
||||
|
||||
2003-02-18 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (MethodEntry.ThisTypeIndex): Renamed to
|
||||
ClassTypeIndex; provide this for all methods so we can get the
|
||||
class of static methods.
|
||||
|
||||
2003-02-10 Nick Drochak <[email protected]>
|
||||
|
||||
* Mono.CSharp.Debugger.build: passing the /r using an 'arg' node works.
|
||||
The <include> node wasn't getting to the compiler. This fixes build
|
||||
breakage on cygwin.
|
||||
|
||||
* MonoSymbolFile.cs: Qualify which Min method. Fixes build breakage
|
||||
on cygwin.
|
||||
|
||||
2003-02-09 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolWriter.cs (MonoSymbolWriter.ctor): We don't need the
|
||||
`mbuilder_array' anymore.
|
||||
|
||||
2003-02-09 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolWriter.cs (SourceFile): Derive from SourceFileEntry.
|
||||
(SourceBlock): We don't need source lines here.
|
||||
(SourceMethod): We're always constructed with source info.
|
||||
|
||||
* MonoSymbolTable.cs: Added support for namespaces.
|
||||
(NamespaceEntry): New struct.
|
||||
(SourceFileEntry.DefineNamespace): New method.
|
||||
(MethodEntry.BuildLineNumberTable): The table is already sorted,
|
||||
so we don't need to do this here.
|
||||
|
||||
2003-02-09 Martin Baulig <[email protected]>
|
||||
|
||||
* IMonoSymbolWriter.cs: Ooops, I forgot to remove this.
|
||||
|
||||
2003-02-08 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolDocumentWriter.cs: Removed.
|
||||
|
||||
* MonoSymbolWriter.cs (SourceFile): Implement ISymbolDocumentWriter.
|
||||
|
||||
2003-02-08 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (GetMethodSource): New public method.
|
||||
(FindMethod): Return the correct index.
|
||||
|
||||
2003-02-07 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (Methods, Sources): New public properties.
|
||||
|
||||
2003-02-07 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (MonoSymbolFile.ReadSymbolFile): New public
|
||||
static method, returns null (without throwing an exception) if the
|
||||
assembly doesn't have any debugging info.
|
||||
|
||||
2003-02-07 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolWriter.cs (MonoSymbolWriter.Initialize): Removed the
|
||||
custom initialization function.
|
||||
|
||||
* MonoSymbolTableWriter.cs: Removed; the code is now in
|
||||
MonoSymbolFile.cs and MonoSymbolWriter.cs.
|
||||
|
||||
2003-02-07 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs: The symbol file is now a resource in the
|
||||
assembly instead of a separate file.
|
||||
|
||||
* MonoSymbolTable.cs: Did a few more cleanups, sort the line
|
||||
number table and remove duplicate line numbers.
|
||||
|
||||
2003-02-05 Martin Baulig <[email protected]>
|
||||
|
||||
Modified the symbol file format to speed up method looks by name
|
||||
and cleaned this up a lot.
|
||||
|
||||
* MonoSymbolFile.cs: New public class. This is now a public class
|
||||
and writes and reads the symbol file.
|
||||
|
||||
* IMonoBinaryReader.cs: Removed.
|
||||
|
||||
* MonoSymbolTable.cs: Set version number to 29.
|
||||
|
||||
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.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/IMonoBinaryReader.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public interface IMonoBinaryReader
|
||||
{
|
||||
long Position {
|
||||
get; set;
|
||||
}
|
||||
|
||||
int ReadInt32 ();
|
||||
|
||||
long ReadInt64 ();
|
||||
|
||||
byte[] ReadBuffer (int size);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/IMonoSymbolWriter.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// This interface is derived from System.Diagnostics.SymbolStore.ISymbolWriter.
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public interface IMonoSymbolWriter : System.Diagnostics.SymbolStore.ISymbolWriter
|
||||
{
|
||||
void Initialize (string assembly_filename, string filename, string[] args);
|
||||
}
|
||||
|
||||
internal enum SourceOffsetType
|
||||
{
|
||||
OFFSET_NONE,
|
||||
OFFSET_IL,
|
||||
OFFSET_LOCAL,
|
||||
OFFSET_PARAMETER
|
||||
}
|
||||
|
||||
internal interface ITypeHandle
|
||||
{
|
||||
string Name {
|
||||
get;
|
||||
}
|
||||
|
||||
Type Type {
|
||||
get;
|
||||
}
|
||||
|
||||
int Token {
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,11 +9,13 @@
|
||||
<csc target="library" output="../lib/Mono.CSharp.Debugger.dll" debug="${debug}">
|
||||
<arg value="/nowarn:1595"/>
|
||||
<arg value="/unsafe"/>
|
||||
<arg value="/r:../lib/corlib.dll"/>
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
<excludes name="Test/**"/>
|
||||
</sources>
|
||||
<references>
|
||||
<includes name="../lib/corlib.dll"/>
|
||||
</references>
|
||||
</csc>
|
||||
</target>
|
||||
<target name="clean">
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/MonoSymbolDocumentWriter.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// This is the default implementation of the
|
||||
// System.Diagnostics.SymbolStore.ISymbolDocumentWriter interface.
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Diagnostics.SymbolStore;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
|
||||
public class MonoSymbolDocumentWriter : ISymbolDocumentWriter
|
||||
{
|
||||
protected string url;
|
||||
|
||||
//
|
||||
// Constructor
|
||||
//
|
||||
public MonoSymbolDocumentWriter (string url)
|
||||
{
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public string FileName {
|
||||
get {
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Interface ISymbolDocumentWriter
|
||||
//
|
||||
|
||||
//
|
||||
// MonoSymbolWriter creates a DWARF 2 debugging file and DWARF operates
|
||||
// on file names, but has no way to include a whole source file in the
|
||||
// symbol file.
|
||||
//
|
||||
|
||||
public void SetCheckSum (Guid algorithmId, byte[] checkSum)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void SetSource (byte[] source)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,607 +0,0 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/MonoSymbolFile.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// (C) 2003 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public class MonoSymbolFileException : Exception
|
||||
{
|
||||
public MonoSymbolFileException ()
|
||||
: base ()
|
||||
{ }
|
||||
|
||||
public MonoSymbolFileException (string message, params object[] args)
|
||||
: base (String.Format (message, args))
|
||||
{ }
|
||||
}
|
||||
|
||||
internal class MyMemoryStream : Stream
|
||||
{
|
||||
int length;
|
||||
int real_length;
|
||||
int position;
|
||||
|
||||
int chunk_size = 4096;
|
||||
ArrayList chunks = new ArrayList ();
|
||||
|
||||
private struct Chunk {
|
||||
public readonly int Offset;
|
||||
public readonly int Length;
|
||||
public byte[] Buffer;
|
||||
|
||||
public Chunk (int offset, int length)
|
||||
{
|
||||
this.Offset = offset;
|
||||
this.Length = length;
|
||||
this.Buffer = new Byte [length];
|
||||
}
|
||||
}
|
||||
|
||||
public override long Position {
|
||||
get { return position; }
|
||||
|
||||
set {
|
||||
if (value > length)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
|
||||
position = (int) value;
|
||||
}
|
||||
}
|
||||
|
||||
public override long Length {
|
||||
get { return length; }
|
||||
}
|
||||
|
||||
public override bool CanRead {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanWrite {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanSeek {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override void SetLength (long new_length)
|
||||
{
|
||||
if (new_length < length)
|
||||
throw new ArgumentException ();
|
||||
|
||||
while (new_length >= real_length) {
|
||||
Chunk new_chunk = new Chunk (real_length, chunk_size);
|
||||
chunks.Add (new_chunk);
|
||||
real_length += chunk_size;
|
||||
}
|
||||
|
||||
length = (int) new_length;
|
||||
}
|
||||
|
||||
public override void Flush ()
|
||||
{ }
|
||||
|
||||
public override long Seek (long offset, SeekOrigin origin)
|
||||
{
|
||||
int ref_point;
|
||||
|
||||
switch (origin) {
|
||||
case SeekOrigin.Begin:
|
||||
ref_point = 0;
|
||||
break;
|
||||
case SeekOrigin.Current:
|
||||
ref_point = position;
|
||||
break;
|
||||
case SeekOrigin.End:
|
||||
ref_point = length;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException ("Invalid SeekOrigin");
|
||||
}
|
||||
|
||||
if ((ref_point + offset < 0) || (offset > real_length))
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
|
||||
position = ref_point + (int) offset;
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
Chunk FindChunk (int offset)
|
||||
{
|
||||
return (Chunk) chunks [offset / chunk_size];
|
||||
}
|
||||
|
||||
public override int Read (byte[] buffer, int offset, int count)
|
||||
{
|
||||
int old_count = count;
|
||||
|
||||
while (count > 0) {
|
||||
Chunk chunk = FindChunk (position);
|
||||
int coffset = position - chunk.Offset;
|
||||
int rest = chunk.Length - coffset;
|
||||
int size = System.Math.Min (count, rest);
|
||||
|
||||
Array.Copy (chunk.Buffer, coffset, buffer, offset, size);
|
||||
position += size;
|
||||
offset += size;
|
||||
count -= size;
|
||||
}
|
||||
|
||||
return old_count;
|
||||
}
|
||||
|
||||
public override void Write (byte[] buffer, int offset, int count)
|
||||
{
|
||||
if (position + count > length)
|
||||
SetLength (position + count);
|
||||
|
||||
while (count > 0) {
|
||||
Chunk chunk = FindChunk (position);
|
||||
int coffset = position - chunk.Offset;
|
||||
int rest = chunk.Length - coffset;
|
||||
int size = System.Math.Min (count, rest);
|
||||
|
||||
Array.Copy (buffer, offset, chunk.Buffer, coffset, size);
|
||||
position += size;
|
||||
offset += size;
|
||||
count -= size;
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] GetContents ()
|
||||
{
|
||||
byte[] retval = new byte [length];
|
||||
position = 0;
|
||||
Read (retval, 0, length);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public class MonoSymbolFile : IDisposable
|
||||
{
|
||||
ArrayList methods = new ArrayList ();
|
||||
ArrayList sources = new ArrayList ();
|
||||
Hashtable method_source_hash = new Hashtable ();
|
||||
Hashtable type_hash = new Hashtable ();
|
||||
|
||||
OffsetTable ot;
|
||||
int last_type_index;
|
||||
int last_method_index;
|
||||
int last_source_index;
|
||||
int last_namespace_index;
|
||||
|
||||
public MonoSymbolFile ()
|
||||
{ }
|
||||
|
||||
internal int AddSource (SourceFileEntry source)
|
||||
{
|
||||
sources.Add (source);
|
||||
return ++last_source_index;
|
||||
}
|
||||
|
||||
internal int DefineType (Type type)
|
||||
{
|
||||
if (type_hash.Contains (type))
|
||||
return (int) type_hash [type];
|
||||
|
||||
int index = ++last_type_index;
|
||||
type_hash.Add (type, index);
|
||||
return index;
|
||||
}
|
||||
|
||||
internal void AddMethod (MethodEntry entry)
|
||||
{
|
||||
methods.Add (entry);
|
||||
}
|
||||
|
||||
internal int GetNextTypeIndex ()
|
||||
{
|
||||
return ++last_type_index;
|
||||
}
|
||||
|
||||
internal int GetNextMethodIndex ()
|
||||
{
|
||||
return ++last_method_index;
|
||||
}
|
||||
|
||||
internal int GetNextNamespaceIndex ()
|
||||
{
|
||||
return ++last_namespace_index;
|
||||
}
|
||||
|
||||
internal void WriteString (BinaryWriter bw, string text)
|
||||
{
|
||||
byte[] data = Encoding.UTF8.GetBytes (text);
|
||||
bw.Write ((int) data.Length);
|
||||
bw.Write (data);
|
||||
StringSize += data.Length;
|
||||
}
|
||||
|
||||
internal string ReadString (int offset)
|
||||
{
|
||||
int old_pos = (int) reader.BaseStream.Position;
|
||||
reader.BaseStream.Position = offset;
|
||||
int length = reader.ReadInt32 ();
|
||||
|
||||
byte[] data = reader.ReadBytes (length);
|
||||
string text = Encoding.UTF8.GetString (data);
|
||||
reader.BaseStream.Position = old_pos;
|
||||
return text;
|
||||
}
|
||||
|
||||
void Write (BinaryWriter bw)
|
||||
{
|
||||
// Magic number and file version.
|
||||
bw.Write (OffsetTable.Magic);
|
||||
bw.Write (OffsetTable.Version);
|
||||
|
||||
//
|
||||
// Offsets of file sections; we must write this after we're done
|
||||
// writing the whole file, so we just reserve the space for it here.
|
||||
//
|
||||
long offset_table_offset = bw.BaseStream.Position;
|
||||
ot.Write (bw);
|
||||
|
||||
//
|
||||
// Write data sections.
|
||||
//
|
||||
ot.DataSectionOffset = (int) bw.BaseStream.Position;
|
||||
foreach (SourceFileEntry source in sources)
|
||||
source.WriteData (bw);
|
||||
ot.DataSectionSize = (int) bw.BaseStream.Position - ot.DataSectionOffset;
|
||||
|
||||
//
|
||||
// Write method table.
|
||||
//
|
||||
ot.MethodTableOffset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < methods.Count; i++) {
|
||||
MethodEntry entry = (MethodEntry) methods [i];
|
||||
entry.WriteIndex (bw);
|
||||
}
|
||||
ot.MethodTableSize = (int) bw.BaseStream.Position - ot.MethodTableOffset;
|
||||
|
||||
//
|
||||
// Write source table.
|
||||
//
|
||||
ot.SourceTableOffset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < sources.Count; i++) {
|
||||
SourceFileEntry source = (SourceFileEntry) sources [i];
|
||||
source.Write (bw);
|
||||
}
|
||||
ot.SourceTableSize = (int) bw.BaseStream.Position - ot.SourceTableOffset;
|
||||
|
||||
//
|
||||
// Fixup offset table.
|
||||
//
|
||||
ot.TypeCount = last_type_index;
|
||||
ot.MethodCount = methods.Count;
|
||||
ot.SourceCount = sources.Count;
|
||||
|
||||
//
|
||||
// Write offset table.
|
||||
//
|
||||
ot.TotalFileSize = (int) bw.BaseStream.Position;
|
||||
bw.Seek ((int) offset_table_offset, SeekOrigin.Begin);
|
||||
ot.Write (bw);
|
||||
bw.Seek (0, SeekOrigin.End);
|
||||
}
|
||||
|
||||
public byte[] CreateSymbolFile ()
|
||||
{
|
||||
if (reader != null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
using (MyMemoryStream stream = new MyMemoryStream ()) {
|
||||
Write (new BinaryWriter (stream));
|
||||
Console.WriteLine ("WROTE SYMFILE: {0} sources, {1} methods, {2} types, " +
|
||||
"{3} line numbers, {4} locals, {5} namespaces, " +
|
||||
"{6} bytes of string data",
|
||||
SourceCount, MethodCount, TypeCount, LineNumberCount,
|
||||
LocalCount, NamespaceCount, StringSize);
|
||||
Console.WriteLine (ot);
|
||||
return stream.GetContents ();
|
||||
}
|
||||
}
|
||||
|
||||
Assembly assembly;
|
||||
BinaryReader reader;
|
||||
Hashtable method_hash;
|
||||
Hashtable source_file_hash;
|
||||
|
||||
Hashtable method_token_hash;
|
||||
Hashtable method_name_hash;
|
||||
Hashtable method_full_name_hash;
|
||||
Hashtable source_name_hash;
|
||||
|
||||
protected MonoSymbolFile (Assembly assembly, Stream stream)
|
||||
{
|
||||
this.assembly = assembly;
|
||||
|
||||
reader = new BinaryReader (stream);
|
||||
|
||||
try {
|
||||
long magic = reader.ReadInt64 ();
|
||||
long version = reader.ReadInt32 ();
|
||||
if ((magic != OffsetTable.Magic) || (version != OffsetTable.Version))
|
||||
throw new MonoSymbolFileException ();
|
||||
ot = new OffsetTable (reader);
|
||||
} catch {
|
||||
throw new MonoSymbolFileException ();
|
||||
}
|
||||
|
||||
method_hash = new Hashtable ();
|
||||
source_file_hash = new Hashtable ();
|
||||
}
|
||||
|
||||
public static MonoSymbolFile ReadSymbolFile (Assembly assembly)
|
||||
{
|
||||
Stream stream = assembly.GetManifestResourceStream ("MonoSymbolFile");
|
||||
if (stream == null)
|
||||
return null;
|
||||
|
||||
return new MonoSymbolFile (assembly, stream);
|
||||
}
|
||||
|
||||
public Assembly Assembly {
|
||||
get { return assembly; }
|
||||
}
|
||||
|
||||
public int SourceCount {
|
||||
get { return ot.SourceCount; }
|
||||
}
|
||||
|
||||
public int MethodCount {
|
||||
get { return ot.MethodCount; }
|
||||
}
|
||||
|
||||
public int TypeCount {
|
||||
get { return ot.TypeCount; }
|
||||
}
|
||||
|
||||
public int NamespaceCount {
|
||||
get { return last_namespace_index; }
|
||||
}
|
||||
|
||||
internal int LineNumberCount = 0;
|
||||
internal int LocalCount = 0;
|
||||
internal int StringSize = 0;
|
||||
|
||||
public SourceFileEntry GetSourceFile (int index)
|
||||
{
|
||||
if ((index < 1) || (index > ot.SourceCount))
|
||||
throw new ArgumentException ();
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
SourceFileEntry source = (SourceFileEntry) source_file_hash [index];
|
||||
if (source != null)
|
||||
return source;
|
||||
|
||||
reader.BaseStream.Position = ot.SourceTableOffset +
|
||||
SourceFileEntry.Size * (index - 1);
|
||||
source = new SourceFileEntry (this, reader);
|
||||
source_file_hash.Add (index, source);
|
||||
return source;
|
||||
}
|
||||
|
||||
public SourceFileEntry[] Sources {
|
||||
get {
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
SourceFileEntry[] retval = new SourceFileEntry [SourceCount];
|
||||
for (int i = 0; i < SourceCount; i++)
|
||||
retval [i] = GetSourceFile (i + 1);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public MethodIndexEntry GetMethodIndexEntry (int index)
|
||||
{
|
||||
int old_pos = (int) reader.BaseStream.Position;
|
||||
reader.BaseStream.Position = ot.MethodTableOffset +
|
||||
MethodIndexEntry.Size * (index - 1);
|
||||
MethodIndexEntry ie = new MethodIndexEntry (reader);
|
||||
reader.BaseStream.Position = old_pos;
|
||||
return ie;
|
||||
}
|
||||
|
||||
public MethodEntry GetMethodByToken (int token)
|
||||
{
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (method_token_hash == null) {
|
||||
method_token_hash = new Hashtable ();
|
||||
|
||||
for (int i = 0; i < MethodCount; i++) {
|
||||
MethodIndexEntry ie = GetMethodIndexEntry (i + 1);
|
||||
|
||||
method_token_hash.Add (ie.Token, i);
|
||||
}
|
||||
}
|
||||
|
||||
object value = method_token_hash [token];
|
||||
if (value == null)
|
||||
return null;
|
||||
|
||||
return GetMethod ((int) value);
|
||||
}
|
||||
|
||||
public MethodEntry GetMethod (MethodBase method)
|
||||
{
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
int token = assembly.MonoDebugger_GetMethodToken (method);
|
||||
return GetMethodByToken (token);
|
||||
}
|
||||
|
||||
public MethodEntry GetMethod (int index)
|
||||
{
|
||||
if ((index < 1) || (index > ot.MethodCount))
|
||||
throw new ArgumentException ();
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
MethodEntry entry = (MethodEntry) method_hash [index];
|
||||
if (entry != null)
|
||||
return entry;
|
||||
|
||||
MethodIndexEntry ie = GetMethodIndexEntry (index);
|
||||
reader.BaseStream.Position = ie.FileOffset;
|
||||
|
||||
entry = new MethodEntry (this, reader, index);
|
||||
method_hash.Add (index, entry);
|
||||
return entry;
|
||||
}
|
||||
|
||||
public MethodEntry[] Methods {
|
||||
get {
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
MethodEntry[] retval = new MethodEntry [MethodCount];
|
||||
for (int i = 0; i < MethodCount; i++)
|
||||
retval [i] = GetMethod (i + 1);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public MethodSourceEntry GetMethodSource (int index)
|
||||
{
|
||||
if ((index < 1) || (index > ot.MethodCount))
|
||||
throw new ArgumentException ();
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
object entry = method_source_hash [index];
|
||||
if (entry != null)
|
||||
return (MethodSourceEntry) entry;
|
||||
|
||||
MethodEntry method = GetMethod (index);
|
||||
foreach (MethodSourceEntry source in method.SourceFile.Methods) {
|
||||
if (source.Index == index) {
|
||||
method_source_hash.Add (index, source);
|
||||
return source;
|
||||
}
|
||||
}
|
||||
|
||||
throw new MonoSymbolFileException ("Internal error.");
|
||||
}
|
||||
|
||||
public int FindMethod (string full_name)
|
||||
{
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (method_full_name_hash == null) {
|
||||
method_full_name_hash = new Hashtable ();
|
||||
|
||||
for (int i = 0; i < ot.MethodCount; i++) {
|
||||
MethodIndexEntry ie = GetMethodIndexEntry (i + 1);
|
||||
string name = ReadString (ie.FullNameOffset);
|
||||
|
||||
method_full_name_hash.Add (name, i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
object value = method_full_name_hash [full_name];
|
||||
if (value == null)
|
||||
return -1;
|
||||
return (int) value;
|
||||
}
|
||||
|
||||
public int[] MethodLookup (string query)
|
||||
{
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
ArrayList list;
|
||||
if (method_name_hash == null) {
|
||||
method_name_hash = new Hashtable ();
|
||||
|
||||
for (int i = 0; i < ot.MethodCount; i++) {
|
||||
MethodIndexEntry ie = GetMethodIndexEntry (i + 1);
|
||||
string full_name = ReadString (ie.FullNameOffset);
|
||||
|
||||
int pos = full_name.IndexOf ('(');
|
||||
string name = full_name.Substring (0, pos);
|
||||
|
||||
list = method_name_hash [name] as ArrayList;
|
||||
if (list == null) {
|
||||
list = new ArrayList ();
|
||||
method_name_hash.Add (name, list);
|
||||
}
|
||||
|
||||
list.Add (i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
list = method_name_hash [query] as ArrayList;
|
||||
if (list == null)
|
||||
return new int [0];
|
||||
|
||||
int[] retval = new int [list.Count];
|
||||
list.CopyTo (retval, 0);
|
||||
return retval;
|
||||
}
|
||||
|
||||
public int FindSource (string file_name)
|
||||
{
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (source_name_hash == null) {
|
||||
source_name_hash = new Hashtable ();
|
||||
|
||||
for (int i = 0; i < ot.SourceCount; i++) {
|
||||
SourceFileEntry source = GetSourceFile (i + 1);
|
||||
|
||||
source_name_hash.Add (source.FileName, i);
|
||||
}
|
||||
}
|
||||
|
||||
object value = source_name_hash [file_name];
|
||||
if (value == null)
|
||||
return -1;
|
||||
return (int) value;
|
||||
}
|
||||
|
||||
internal BinaryReader BinaryReader {
|
||||
get {
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
return reader;
|
||||
}
|
||||
}
|
||||
|
||||
void IDisposable.Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing) {
|
||||
if (reader != null) {
|
||||
reader.Close ();
|
||||
reader = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,55 +18,64 @@ namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public struct OffsetTable
|
||||
{
|
||||
public const int Version = 33;
|
||||
public const int Version = 28;
|
||||
public const long Magic = 0x45e82623fd7fa614;
|
||||
|
||||
public int TotalFileSize;
|
||||
public int DataSectionOffset;
|
||||
public int DataSectionSize;
|
||||
public int SourceCount;
|
||||
public int SourceTableOffset;
|
||||
public int SourceTableSize;
|
||||
public int MethodCount;
|
||||
public int MethodTableOffset;
|
||||
public int MethodTableSize;
|
||||
public int TypeCount;
|
||||
public int total_file_size;
|
||||
public int source_table_offset;
|
||||
public int source_table_size;
|
||||
public int method_count;
|
||||
public int method_table_offset;
|
||||
public int method_table_size;
|
||||
public int line_number_table_offset;
|
||||
public int line_number_table_size;
|
||||
public int local_variable_table_offset;
|
||||
public int local_variable_table_size;
|
||||
public int source_file_table_offset;
|
||||
public int source_file_table_size;
|
||||
public int source_file_count;
|
||||
public int type_count;
|
||||
public int type_index_table_offset;
|
||||
public int type_index_table_size;
|
||||
|
||||
internal OffsetTable (BinaryReader reader)
|
||||
public OffsetTable (IMonoBinaryReader reader)
|
||||
{
|
||||
TotalFileSize = reader.ReadInt32 ();
|
||||
DataSectionOffset = reader.ReadInt32 ();
|
||||
DataSectionSize = reader.ReadInt32 ();
|
||||
SourceCount = reader.ReadInt32 ();
|
||||
SourceTableOffset = reader.ReadInt32 ();
|
||||
SourceTableSize = reader.ReadInt32 ();
|
||||
MethodCount = reader.ReadInt32 ();
|
||||
MethodTableOffset = reader.ReadInt32 ();
|
||||
MethodTableSize = reader.ReadInt32 ();
|
||||
TypeCount = reader.ReadInt32 ();
|
||||
total_file_size = reader.ReadInt32 ();
|
||||
source_table_offset = reader.ReadInt32 ();
|
||||
source_table_size = reader.ReadInt32 ();
|
||||
method_count = reader.ReadInt32 ();
|
||||
method_table_offset = reader.ReadInt32 ();
|
||||
method_table_size = reader.ReadInt32 ();
|
||||
line_number_table_offset = reader.ReadInt32 ();
|
||||
line_number_table_size = reader.ReadInt32 ();
|
||||
local_variable_table_offset = reader.ReadInt32 ();
|
||||
local_variable_table_size = reader.ReadInt32 ();
|
||||
source_file_table_offset = reader.ReadInt32 ();
|
||||
source_file_table_size = reader.ReadInt32 ();
|
||||
source_file_count = reader.ReadInt32 ();
|
||||
type_count = reader.ReadInt32 ();
|
||||
type_index_table_offset = reader.ReadInt32 ();
|
||||
type_index_table_size = reader.ReadInt32 ();
|
||||
}
|
||||
|
||||
internal void Write (BinaryWriter bw)
|
||||
public void Write (BinaryWriter bw)
|
||||
{
|
||||
bw.Write (TotalFileSize);
|
||||
bw.Write (DataSectionOffset);
|
||||
bw.Write (DataSectionSize);
|
||||
bw.Write (SourceCount);
|
||||
bw.Write (SourceTableOffset);
|
||||
bw.Write (SourceTableSize);
|
||||
bw.Write (MethodCount);
|
||||
bw.Write (MethodTableOffset);
|
||||
bw.Write (MethodTableSize);
|
||||
bw.Write (TypeCount);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format (
|
||||
"OffsetTable [{0} - {1}:{2} - {3}:{4}:{5} - {6}:{7}:{8} - {9}]",
|
||||
TotalFileSize, DataSectionOffset, DataSectionSize, SourceCount,
|
||||
SourceTableOffset, SourceTableSize, MethodCount, MethodTableOffset,
|
||||
MethodTableSize, TypeCount);
|
||||
bw.Write (total_file_size);
|
||||
bw.Write (source_table_offset);
|
||||
bw.Write (source_table_size);
|
||||
bw.Write (method_count);
|
||||
bw.Write (method_table_offset);
|
||||
bw.Write (method_table_size);
|
||||
bw.Write (line_number_table_offset);
|
||||
bw.Write (line_number_table_size);
|
||||
bw.Write (local_variable_table_offset);
|
||||
bw.Write (local_variable_table_size);
|
||||
bw.Write (source_file_table_offset);
|
||||
bw.Write (source_file_table_size);
|
||||
bw.Write (source_file_count);
|
||||
bw.Write (type_count);
|
||||
bw.Write (type_index_table_offset);
|
||||
bw.Write (type_index_table_size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,9 +90,11 @@ namespace Mono.CSharp.Debugger
|
||||
this.Offset = offset;
|
||||
}
|
||||
|
||||
public static LineNumberEntry Null = new LineNumberEntry (0, 0);
|
||||
internal LineNumberEntry (SourceLine line)
|
||||
: this (line.Row, line.Offset)
|
||||
{ }
|
||||
|
||||
internal LineNumberEntry (BinaryReader reader)
|
||||
public LineNumberEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
Row = reader.ReadInt32 ();
|
||||
Offset = reader.ReadInt32 ();
|
||||
@@ -95,41 +106,6 @@ namespace Mono.CSharp.Debugger
|
||||
bw.Write (Offset);
|
||||
}
|
||||
|
||||
private class OffsetComparerClass : IComparer
|
||||
{
|
||||
public int Compare (object a, object b)
|
||||
{
|
||||
LineNumberEntry l1 = (LineNumberEntry) a;
|
||||
LineNumberEntry l2 = (LineNumberEntry) b;
|
||||
|
||||
if (l1.Offset < l2.Offset)
|
||||
return -1;
|
||||
else if (l1.Offset > l2.Offset)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private class RowComparerClass : IComparer
|
||||
{
|
||||
public int Compare (object a, object b)
|
||||
{
|
||||
LineNumberEntry l1 = (LineNumberEntry) a;
|
||||
LineNumberEntry l2 = (LineNumberEntry) b;
|
||||
|
||||
if (l1.Row < l2.Row)
|
||||
return -1;
|
||||
else if (l1.Row > l2.Row)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly IComparer OffsetComparer = new OffsetComparerClass ();
|
||||
public static readonly IComparer RowComparer = new RowComparerClass ();
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("[Line {0}:{1}]", Row, Offset);
|
||||
@@ -149,19 +125,21 @@ namespace Mono.CSharp.Debugger
|
||||
this.Signature = Signature;
|
||||
}
|
||||
|
||||
internal LocalVariableEntry (BinaryReader reader)
|
||||
public LocalVariableEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
int name_length = reader.ReadInt32 ();
|
||||
byte[] name = reader.ReadBytes (name_length);
|
||||
byte[] name = reader.ReadBuffer (name_length);
|
||||
Name = Encoding.UTF8.GetString (name);
|
||||
Attributes = (FieldAttributes) reader.ReadInt32 ();
|
||||
int sig_length = reader.ReadInt32 ();
|
||||
Signature = reader.ReadBytes (sig_length);
|
||||
Signature = reader.ReadBuffer (sig_length);
|
||||
}
|
||||
|
||||
internal void Write (MonoSymbolFile file, BinaryWriter bw)
|
||||
internal void Write (BinaryWriter bw)
|
||||
{
|
||||
file.WriteString (bw, Name);
|
||||
byte[] name = Encoding.UTF8.GetBytes (Name);
|
||||
bw.Write ((int) name.Length);
|
||||
bw.Write (name);
|
||||
bw.Write ((int) Attributes);
|
||||
bw.Write ((int) Signature.Length);
|
||||
bw.Write (Signature);
|
||||
@@ -175,129 +153,74 @@ namespace Mono.CSharp.Debugger
|
||||
|
||||
public class SourceFileEntry
|
||||
{
|
||||
MonoSymbolFile file;
|
||||
string file_name;
|
||||
public readonly string SourceFile;
|
||||
|
||||
IMonoBinaryReader reader;
|
||||
long method_position;
|
||||
ArrayList methods;
|
||||
ArrayList namespaces;
|
||||
int index, count, name_offset, method_offset;
|
||||
int namespace_count, nstable_offset;
|
||||
bool creating;
|
||||
int count;
|
||||
|
||||
public static int Size {
|
||||
get { return 24; }
|
||||
internal SourceFileEntry (string source_file)
|
||||
{
|
||||
this.SourceFile = source_file;
|
||||
this.methods = new ArrayList ();
|
||||
this.count = 0;
|
||||
}
|
||||
|
||||
internal SourceFileEntry (MonoSymbolFile file, string file_name)
|
||||
internal void AddMethod (MethodSourceEntry method)
|
||||
{
|
||||
this.file = file;
|
||||
this.file_name = file_name;
|
||||
this.index = file.AddSource (this);
|
||||
|
||||
creating = true;
|
||||
methods = new ArrayList ();
|
||||
namespaces = new ArrayList ();
|
||||
}
|
||||
|
||||
public void DefineMethod (MethodBase method, int token, LocalVariableEntry[] locals,
|
||||
LineNumberEntry[] lines, int start, int end, int namespace_id)
|
||||
{
|
||||
if (!creating)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
MethodEntry entry = new MethodEntry (
|
||||
file, this, method, token, locals, lines, start, end, namespace_id);
|
||||
|
||||
methods.Add (entry);
|
||||
file.AddMethod (entry);
|
||||
}
|
||||
|
||||
public int DefineNamespace (string name, string[] using_clauses, int parent)
|
||||
{
|
||||
if (!creating)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
int index = file.GetNextNamespaceIndex ();
|
||||
NamespaceEntry ns = new NamespaceEntry (name, index, using_clauses, parent);
|
||||
namespaces.Add (ns);
|
||||
return index;
|
||||
}
|
||||
|
||||
internal void WriteData (BinaryWriter bw)
|
||||
{
|
||||
name_offset = (int) bw.BaseStream.Position;
|
||||
file.WriteString (bw, file_name);
|
||||
|
||||
ArrayList list = new ArrayList ();
|
||||
foreach (MethodEntry entry in methods)
|
||||
list.Add (entry.Write (file, bw));
|
||||
list.Sort ();
|
||||
count = list.Count;
|
||||
|
||||
method_offset = (int) bw.BaseStream.Position;
|
||||
foreach (MethodSourceEntry method in list)
|
||||
method.Write (bw);
|
||||
|
||||
namespace_count = namespaces.Count;
|
||||
nstable_offset = (int) bw.BaseStream.Position;
|
||||
foreach (NamespaceEntry ns in namespaces)
|
||||
ns.Write (file, bw);
|
||||
methods.Add (method);
|
||||
count++;
|
||||
}
|
||||
|
||||
internal void Write (BinaryWriter bw)
|
||||
{
|
||||
bw.Write (index);
|
||||
bw.Write (count);
|
||||
bw.Write (namespace_count);
|
||||
bw.Write (name_offset);
|
||||
bw.Write (method_offset);
|
||||
bw.Write (nstable_offset);
|
||||
byte[] name = Encoding.UTF8.GetBytes (SourceFile);
|
||||
bw.Write ((int) name.Length);
|
||||
bw.Write (name);
|
||||
|
||||
methods.Sort ();
|
||||
bw.Write (methods.Count);
|
||||
foreach (MethodSourceEntry method in methods)
|
||||
method.Write (bw);
|
||||
}
|
||||
|
||||
internal SourceFileEntry (MonoSymbolFile file, BinaryReader reader)
|
||||
public SourceFileEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
this.file = file;
|
||||
int name_length = reader.ReadInt32 ();
|
||||
byte[] name = reader.ReadBuffer (name_length);
|
||||
SourceFile = Encoding.UTF8.GetString (name);
|
||||
|
||||
index = reader.ReadInt32 ();
|
||||
count = reader.ReadInt32 ();
|
||||
namespace_count = reader.ReadInt32 ();
|
||||
name_offset = reader.ReadInt32 ();
|
||||
method_offset = reader.ReadInt32 ();
|
||||
nstable_offset = reader.ReadInt32 ();
|
||||
this.reader = reader;
|
||||
this.method_position = reader.Position;
|
||||
|
||||
file_name = file.ReadString (name_offset);
|
||||
}
|
||||
|
||||
public int Index {
|
||||
get { return index; }
|
||||
}
|
||||
|
||||
public string FileName {
|
||||
get { return file_name; }
|
||||
reader.Position += count * MethodSourceEntry.Size;
|
||||
}
|
||||
|
||||
public MethodSourceEntry[] Methods {
|
||||
get {
|
||||
if (creating)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
BinaryReader reader = file.BinaryReader;
|
||||
int old_pos = (int) reader.BaseStream.Position;
|
||||
|
||||
reader.BaseStream.Position = method_offset;
|
||||
ArrayList list = new ArrayList ();
|
||||
for (int i = 0; i < count; i ++)
|
||||
list.Add (new MethodSourceEntry (reader));
|
||||
reader.BaseStream.Position = old_pos;
|
||||
|
||||
MethodSourceEntry[] retval = new MethodSourceEntry [count];
|
||||
list.CopyTo (retval, 0);
|
||||
read_methods ();
|
||||
MethodSourceEntry[] retval = new MethodSourceEntry [methods.Count];
|
||||
methods.CopyTo (retval, 0);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
void read_methods ()
|
||||
{
|
||||
if (methods != null)
|
||||
return;
|
||||
|
||||
reader.Position = method_position;
|
||||
methods = new ArrayList ();
|
||||
for (int i = 0; i < count; i++)
|
||||
methods.Add (new MethodSourceEntry (reader));
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("SourceFileEntry ({0}:{1}:{2})", index, file_name, count);
|
||||
return String.Format ("SourceFileEntry ({0}:{1})", SourceFile, count);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,7 +239,7 @@ namespace Mono.CSharp.Debugger
|
||||
this.EndRow = end;
|
||||
}
|
||||
|
||||
internal MethodSourceEntry (BinaryReader reader)
|
||||
public MethodSourceEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
Index = reader.ReadInt32 ();
|
||||
FileOffset = reader.ReadInt32 ();
|
||||
@@ -324,8 +247,11 @@ namespace Mono.CSharp.Debugger
|
||||
EndRow = reader.ReadInt32 ();
|
||||
}
|
||||
|
||||
public static int Size {
|
||||
get { return 16; }
|
||||
public static int Size
|
||||
{
|
||||
get {
|
||||
return 16;
|
||||
}
|
||||
}
|
||||
|
||||
internal void Write (BinaryWriter bw)
|
||||
@@ -355,152 +281,84 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
public struct MethodIndexEntry
|
||||
{
|
||||
public readonly int FileOffset;
|
||||
public readonly int FullNameOffset;
|
||||
public readonly int Token;
|
||||
|
||||
public static int Size {
|
||||
get { return 12; }
|
||||
}
|
||||
|
||||
public MethodIndexEntry (int offset, int name_offset, int token)
|
||||
{
|
||||
this.FileOffset = offset;
|
||||
this.FullNameOffset = name_offset;
|
||||
this.Token = token;
|
||||
}
|
||||
|
||||
internal MethodIndexEntry (BinaryReader reader)
|
||||
{
|
||||
FileOffset = reader.ReadInt32 ();
|
||||
FullNameOffset = reader.ReadInt32 ();
|
||||
Token = reader.ReadInt32 ();
|
||||
}
|
||||
|
||||
internal void Write (BinaryWriter bw)
|
||||
{
|
||||
bw.Write (FileOffset);
|
||||
bw.Write (FullNameOffset);
|
||||
bw.Write (Token);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("MethodIndexEntry ({0}:{1}:{2:x})",
|
||||
FileOffset, FullNameOffset, Token);
|
||||
}
|
||||
}
|
||||
|
||||
public class MethodEntry
|
||||
{
|
||||
#region This is actually written to the symbol file
|
||||
public readonly int SourceFileIndex;
|
||||
public readonly int Token;
|
||||
public readonly int StartRow;
|
||||
public readonly int EndRow;
|
||||
public readonly int ClassTypeIndex;
|
||||
public readonly int NumLineNumbers;
|
||||
public readonly int ThisTypeIndex;
|
||||
public readonly int NumParameters;
|
||||
public readonly int NumLocals;
|
||||
public readonly int NumLineNumbers;
|
||||
public readonly int NamespaceID;
|
||||
|
||||
int NameOffset;
|
||||
int FullNameOffset;
|
||||
int TypeIndexTableOffset;
|
||||
int LocalVariableTableOffset;
|
||||
int LineNumberTableOffset;
|
||||
#endregion
|
||||
public int TypeIndexTableOffset;
|
||||
public int LocalVariableTableOffset;
|
||||
public readonly int SourceFileOffset;
|
||||
public readonly int LineNumberTableOffset;
|
||||
|
||||
int index;
|
||||
int file_offset;
|
||||
string name;
|
||||
string full_name;
|
||||
MethodIndexEntry index_entry;
|
||||
public readonly string SourceFile = null;
|
||||
public readonly LineNumberEntry[] LineNumbers = null;
|
||||
public readonly int[] ParamTypeIndices = null;
|
||||
public readonly int[] LocalTypeIndices = null;
|
||||
public readonly LocalVariableEntry[] Locals = null;
|
||||
|
||||
public readonly SourceFileEntry SourceFile;
|
||||
public readonly LineNumberEntry[] LineNumbers;
|
||||
public readonly int[] ParamTypeIndices;
|
||||
public readonly int[] LocalTypeIndices;
|
||||
public readonly LocalVariableEntry[] Locals;
|
||||
public readonly Type[] LocalTypes;
|
||||
|
||||
public readonly MonoSymbolFile SymbolFile;
|
||||
|
||||
public static int Size {
|
||||
get { return 52; }
|
||||
}
|
||||
|
||||
public string Name {
|
||||
get { return name; }
|
||||
}
|
||||
|
||||
public string FullName {
|
||||
get { return full_name; }
|
||||
}
|
||||
|
||||
public MethodBase MethodBase {
|
||||
get { return SymbolFile.Assembly.MonoDebugger_GetMethod (Token); }
|
||||
public static int Size
|
||||
{
|
||||
get {
|
||||
return 44;
|
||||
}
|
||||
}
|
||||
|
||||
internal MethodEntry (MonoSymbolFile file, BinaryReader reader, int index)
|
||||
public MethodEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
this.SymbolFile = file;
|
||||
this.index = index;
|
||||
SourceFileIndex = reader.ReadInt32 ();
|
||||
Token = reader.ReadInt32 ();
|
||||
StartRow = reader.ReadInt32 ();
|
||||
EndRow = reader.ReadInt32 ();
|
||||
ClassTypeIndex = reader.ReadInt32 ();
|
||||
ThisTypeIndex = reader.ReadInt32 ();
|
||||
NumParameters = reader.ReadInt32 ();
|
||||
NumLocals = reader.ReadInt32 ();
|
||||
NumLineNumbers = reader.ReadInt32 ();
|
||||
NameOffset = reader.ReadInt32 ();
|
||||
FullNameOffset = reader.ReadInt32 ();
|
||||
TypeIndexTableOffset = reader.ReadInt32 ();
|
||||
LocalVariableTableOffset = reader.ReadInt32 ();
|
||||
SourceFileOffset = reader.ReadInt32 ();
|
||||
LineNumberTableOffset = reader.ReadInt32 ();
|
||||
NamespaceID = reader.ReadInt32 ();
|
||||
|
||||
name = file.ReadString (NameOffset);
|
||||
full_name = file.ReadString (FullNameOffset);
|
||||
|
||||
SourceFile = file.GetSourceFile (SourceFileIndex);
|
||||
if (SourceFileOffset != 0) {
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = SourceFileOffset;
|
||||
int source_file_length = reader.ReadInt32 ();
|
||||
byte[] source_file = reader.ReadBuffer (source_file_length);
|
||||
SourceFile = Encoding.UTF8.GetString (source_file);
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
|
||||
if (LineNumberTableOffset != 0) {
|
||||
long old_pos = reader.BaseStream.Position;
|
||||
reader.BaseStream.Position = LineNumberTableOffset;
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = LineNumberTableOffset;
|
||||
|
||||
LineNumbers = new LineNumberEntry [NumLineNumbers];
|
||||
|
||||
for (int i = 0; i < NumLineNumbers; i++)
|
||||
LineNumbers [i] = new LineNumberEntry (reader);
|
||||
|
||||
reader.BaseStream.Position = old_pos;
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
|
||||
if (LocalVariableTableOffset != 0) {
|
||||
long old_pos = reader.BaseStream.Position;
|
||||
reader.BaseStream.Position = LocalVariableTableOffset;
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = LocalVariableTableOffset;
|
||||
|
||||
Locals = new LocalVariableEntry [NumLocals];
|
||||
LocalTypes = new Type [NumLocals];
|
||||
|
||||
Assembly ass = file.Assembly;
|
||||
|
||||
for (int i = 0; i < NumLocals; i++) {
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
Locals [i] = new LocalVariableEntry (reader);
|
||||
LocalTypes [i] = ass.MonoDebugger_GetLocalTypeFromSignature (
|
||||
Locals [i].Signature);
|
||||
}
|
||||
|
||||
reader.BaseStream.Position = old_pos;
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
|
||||
if (TypeIndexTableOffset != 0) {
|
||||
long old_pos = reader.BaseStream.Position;
|
||||
reader.BaseStream.Position = TypeIndexTableOffset;
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = TypeIndexTableOffset;
|
||||
|
||||
ParamTypeIndices = new int [NumParameters];
|
||||
LocalTypeIndices = new int [NumLocals];
|
||||
@@ -510,180 +368,52 @@ namespace Mono.CSharp.Debugger
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
LocalTypeIndices [i] = reader.ReadInt32 ();
|
||||
|
||||
reader.BaseStream.Position = old_pos;
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
}
|
||||
|
||||
internal MethodEntry (MonoSymbolFile file, SourceFileEntry source, MethodBase method,
|
||||
int token, LocalVariableEntry[] locals, LineNumberEntry[] lines,
|
||||
int start_row, int end_row, int namespace_id)
|
||||
internal MethodEntry (int token, int sf_offset, string source_file,
|
||||
int this_type_index, int[] param_type_indices,
|
||||
int[] local_type_indices, LocalVariableEntry[] locals,
|
||||
LineNumberEntry[] lines, int lnt_offset,
|
||||
int start_row, int end_row)
|
||||
{
|
||||
this.SymbolFile = file;
|
||||
index = file.GetNextMethodIndex ();
|
||||
|
||||
Token = token;
|
||||
SourceFileIndex = source.Index;
|
||||
SourceFile = source;
|
||||
StartRow = start_row;
|
||||
EndRow = end_row;
|
||||
NamespaceID = namespace_id;
|
||||
|
||||
LineNumbers = BuildLineNumberTable (lines);
|
||||
NumLineNumbers = LineNumbers.Length;
|
||||
|
||||
ParameterInfo[] parameters = method.GetParameters ();
|
||||
if (parameters == null)
|
||||
parameters = new ParameterInfo [0];
|
||||
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
sb.Append (method.DeclaringType.FullName);
|
||||
sb.Append (".");
|
||||
sb.Append (method.Name);
|
||||
sb.Append ("(");
|
||||
for (int i = 0; i < parameters.Length; i++) {
|
||||
if (i > 0)
|
||||
sb.Append (",");
|
||||
sb.Append (parameters [i].ParameterType.FullName);
|
||||
}
|
||||
sb.Append (")");
|
||||
|
||||
name = method.Name;
|
||||
full_name = sb.ToString ();
|
||||
|
||||
NumParameters = parameters.Length;
|
||||
ParamTypeIndices = new int [NumParameters];
|
||||
for (int i = 0; i < NumParameters; i++)
|
||||
ParamTypeIndices [i] = file.DefineType (parameters [i].ParameterType);
|
||||
|
||||
NumLocals = locals.Length;
|
||||
Locals = locals;
|
||||
|
||||
LocalTypeIndices = new int [NumLocals];
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
LocalTypeIndices [i] = file.GetNextTypeIndex ();
|
||||
|
||||
ClassTypeIndex = file.DefineType (method.ReflectedType);
|
||||
this.Token = token;
|
||||
this.StartRow = start_row;
|
||||
this.EndRow = end_row;
|
||||
this.NumLineNumbers = lines.Length;
|
||||
this.ThisTypeIndex = this_type_index;
|
||||
this.NumParameters = param_type_indices.Length;
|
||||
this.NumLocals = local_type_indices.Length;
|
||||
this.ParamTypeIndices = param_type_indices;
|
||||
this.LocalTypeIndices = local_type_indices;
|
||||
this.Locals = locals;
|
||||
this.SourceFileOffset = sf_offset;
|
||||
this.LineNumberTableOffset = lnt_offset;
|
||||
this.SourceFile = source_file;
|
||||
this.LineNumbers = lines;
|
||||
}
|
||||
|
||||
LineNumberEntry[] BuildLineNumberTable (LineNumberEntry[] line_numbers)
|
||||
internal void Write (BinaryWriter bw)
|
||||
{
|
||||
ArrayList list = new ArrayList ();
|
||||
int last_offset = -1;
|
||||
int last_row = -1;
|
||||
|
||||
for (int i = 0; i < line_numbers.Length; i++) {
|
||||
LineNumberEntry line = (LineNumberEntry) line_numbers [i];
|
||||
|
||||
if (line.Offset > last_offset) {
|
||||
if (last_row >= 0)
|
||||
list.Add (new LineNumberEntry (last_row, last_offset));
|
||||
last_row = line.Row;
|
||||
last_offset = line.Offset;
|
||||
} else if (line.Row > last_row) {
|
||||
last_row = line.Row;
|
||||
}
|
||||
}
|
||||
|
||||
if (last_row >= 0)
|
||||
list.Add (new LineNumberEntry (last_row, last_offset));
|
||||
|
||||
LineNumberEntry[] retval = new LineNumberEntry [list.Count];
|
||||
list.CopyTo (retval, 0);
|
||||
return retval;
|
||||
}
|
||||
|
||||
internal MethodSourceEntry Write (MonoSymbolFile file, BinaryWriter bw)
|
||||
{
|
||||
NameOffset = (int) bw.BaseStream.Position;
|
||||
file.WriteString (bw, name);
|
||||
|
||||
FullNameOffset = (int) bw.BaseStream.Position;
|
||||
file.WriteString (bw, full_name);
|
||||
|
||||
TypeIndexTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int i = 0; i < NumParameters; i++)
|
||||
bw.Write (ParamTypeIndices [i]);
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
bw.Write (LocalTypeIndices [i]);
|
||||
|
||||
LocalVariableTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
Locals [i].Write (file, bw);
|
||||
|
||||
LineNumberTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int i = 0; i < NumLineNumbers; i++)
|
||||
LineNumbers [i].Write (bw);
|
||||
|
||||
file.LineNumberCount += NumLineNumbers;
|
||||
file.LocalCount += NumLocals;
|
||||
|
||||
file_offset = (int) bw.BaseStream.Position;
|
||||
|
||||
index_entry = new MethodIndexEntry (file_offset, FullNameOffset, Token);
|
||||
|
||||
bw.Write (SourceFileIndex);
|
||||
bw.Write (Token);
|
||||
bw.Write (StartRow);
|
||||
bw.Write (EndRow);
|
||||
bw.Write (ClassTypeIndex);
|
||||
bw.Write (ThisTypeIndex);
|
||||
bw.Write (NumParameters);
|
||||
bw.Write (NumLocals);
|
||||
bw.Write (NumLineNumbers);
|
||||
bw.Write (NameOffset);
|
||||
bw.Write (FullNameOffset);
|
||||
bw.Write (TypeIndexTableOffset);
|
||||
bw.Write (LocalVariableTableOffset);
|
||||
bw.Write (SourceFileOffset);
|
||||
bw.Write (LineNumberTableOffset);
|
||||
bw.Write (NamespaceID);
|
||||
|
||||
return new MethodSourceEntry (index, file_offset, StartRow, EndRow);
|
||||
}
|
||||
|
||||
internal void WriteIndex (BinaryWriter bw)
|
||||
{
|
||||
index_entry.Write (bw);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("[Method {0}:{1}:{2}:{3}:{4} - {7}:{8}:{9}:{10} - {5} - {6}]",
|
||||
index, Token, SourceFileIndex, StartRow, EndRow,
|
||||
SourceFile, FullName, ClassTypeIndex, NumParameters,
|
||||
NumLocals, NumLineNumbers);
|
||||
}
|
||||
}
|
||||
|
||||
public struct NamespaceEntry
|
||||
{
|
||||
public readonly string Name;
|
||||
public readonly int Index;
|
||||
public readonly int Parent;
|
||||
public readonly string[] UsingClauses;
|
||||
|
||||
public NamespaceEntry (string name, int index, string[] using_clauses, int parent)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Index = index;
|
||||
this.Parent = parent;
|
||||
this.UsingClauses = using_clauses != null ? using_clauses : new string [0];
|
||||
}
|
||||
|
||||
internal void Write (MonoSymbolFile file, BinaryWriter bw)
|
||||
{
|
||||
file.WriteString (bw, Name);
|
||||
bw.Write (Index);
|
||||
bw.Write (Parent);
|
||||
bw.Write (UsingClauses.Length);
|
||||
foreach (string uc in UsingClauses)
|
||||
file.WriteString (bw, uc);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("[Namespace {0}:{1}:{2}]", Name, Index, Parent);
|
||||
return String.Format ("[Method {0}:{1}:{2}:{3}:{4} - {5}:{6}]",
|
||||
Token, SourceFile, StartRow, EndRow,
|
||||
NumLineNumbers, SourceFileOffset, LineNumberTableOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/MonoSymbolTableWriter.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
internal class MonoSymbolTableWriter : IDisposable
|
||||
{
|
||||
BinaryWriter bw;
|
||||
Hashtable type_hash;
|
||||
int last_type_index;
|
||||
|
||||
public MonoSymbolTableWriter (string output_filename)
|
||||
{
|
||||
FileStream stream = new FileStream (output_filename, FileMode.Create);
|
||||
bw = new BinaryWriter (stream);
|
||||
type_hash = new Hashtable ();
|
||||
}
|
||||
|
||||
int GetTypeIndex (Type type)
|
||||
{
|
||||
if (type_hash.Contains (type))
|
||||
return (int) type_hash [type];
|
||||
|
||||
int index = ++last_type_index;
|
||||
type_hash.Add (type, index);
|
||||
return index;
|
||||
}
|
||||
|
||||
public void WriteSymbolTable (MonoSymbolWriter symwriter)
|
||||
{
|
||||
// Magic number and file version.
|
||||
bw.Write (OffsetTable.Magic);
|
||||
bw.Write (OffsetTable.Version);
|
||||
|
||||
OffsetTable ot = new OffsetTable ();
|
||||
|
||||
//
|
||||
// Offsets of file sections; we must write this after we're done
|
||||
// writing the whole file, so we just reserve the space for it here.
|
||||
//
|
||||
long offset_table_offset = bw.BaseStream.Position;
|
||||
ot.Write (bw);
|
||||
|
||||
//
|
||||
// Write source file table.
|
||||
//
|
||||
Hashtable sources = new Hashtable ();
|
||||
|
||||
ot.source_table_offset = (int) bw.BaseStream.Position;
|
||||
foreach (SourceFile source in symwriter.Sources) {
|
||||
if (sources.ContainsKey (source))
|
||||
continue;
|
||||
|
||||
sources.Add (source, (int) bw.BaseStream.Position);
|
||||
byte[] file_name = Encoding.UTF8.GetBytes (source.FileName);
|
||||
bw.Write ((int) file_name.Length);
|
||||
bw.Write (file_name);
|
||||
}
|
||||
ot.source_table_size = (int) bw.BaseStream.Position - ot.source_table_offset;
|
||||
|
||||
Hashtable source_table = new Hashtable ();
|
||||
|
||||
//
|
||||
// Write line number table
|
||||
//
|
||||
ArrayList methods = new ArrayList ();
|
||||
|
||||
int num_methods = 0;
|
||||
|
||||
ot.line_number_table_offset = (int) bw.BaseStream.Position;
|
||||
foreach (SourceMethod method in symwriter.Methods) {
|
||||
if (method.Start == null || method.Start.Row == 0)
|
||||
continue;
|
||||
|
||||
int count = method.Lines.Length;
|
||||
LineNumberEntry[] lines = new LineNumberEntry [count];
|
||||
|
||||
int pos = (int) bw.BaseStream.Position;
|
||||
|
||||
int num_params = method.Parameters.Length;
|
||||
int[] param_type_indices = new int [num_params];
|
||||
for (int i = 0; i < num_params; i++) {
|
||||
Type type = method.Parameters [i].ParameterType;
|
||||
param_type_indices [i] = GetTypeIndex (type);
|
||||
}
|
||||
|
||||
int num_locals = method.Locals.Length;
|
||||
int[] local_type_indices = new int [num_locals];
|
||||
for (int i = 0; i < num_locals; i++)
|
||||
local_type_indices [i] = ++last_type_index;
|
||||
|
||||
int type_index_table_offset = ot.type_index_table_size;
|
||||
ot.type_index_table_size += 4 * (num_params + num_locals);
|
||||
|
||||
int this_type_index = 0;
|
||||
if (!method.MethodBase.IsStatic)
|
||||
this_type_index = GetTypeIndex (method.MethodBase.ReflectedType);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
lines [i] = new LineNumberEntry (method.Lines [i]);
|
||||
lines [i].Write (bw);
|
||||
}
|
||||
|
||||
MethodEntry entry = new MethodEntry (
|
||||
(int) method.Token, (int) sources [method.SourceFile],
|
||||
method.SourceFile.FileName, this_type_index,
|
||||
param_type_indices, local_type_indices, method.Locals, lines, pos,
|
||||
(int) method.Start.Row, (int) method.End.Row);
|
||||
|
||||
methods.Add (entry);
|
||||
}
|
||||
ot.line_number_table_size = (int) bw.BaseStream.Position -
|
||||
ot.line_number_table_offset;
|
||||
|
||||
//
|
||||
// Write type index table.
|
||||
//
|
||||
|
||||
ot.type_index_table_offset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < methods.Count; i++) {
|
||||
MethodEntry entry = (MethodEntry) methods [i];
|
||||
|
||||
entry.TypeIndexTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int j = 0; j < entry.NumParameters; j++)
|
||||
bw.Write (entry.ParamTypeIndices [j]);
|
||||
for (int j = 0; j < entry.NumLocals; j++)
|
||||
bw.Write (entry.LocalTypeIndices [j]);
|
||||
}
|
||||
ot.type_index_table_size = (int) bw.BaseStream.Position -
|
||||
ot.type_index_table_offset;
|
||||
|
||||
//
|
||||
// Write local variable table.
|
||||
//
|
||||
|
||||
ot.local_variable_table_offset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < methods.Count; i++) {
|
||||
MethodEntry entry = (MethodEntry) methods [i];
|
||||
|
||||
entry.LocalVariableTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int j = 0; j < entry.NumLocals; j++)
|
||||
entry.Locals [j].Write (bw);
|
||||
}
|
||||
ot.local_variable_table_size = (int) bw.BaseStream.Position -
|
||||
ot.local_variable_table_offset;
|
||||
|
||||
//
|
||||
// Write method table
|
||||
//
|
||||
ot.method_count = methods.Count;
|
||||
ot.method_table_offset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < methods.Count; i++) {
|
||||
MethodEntry entry = (MethodEntry) methods [i];
|
||||
SourceFileEntry source = (SourceFileEntry) source_table [entry.SourceFileOffset];
|
||||
if (source == null) {
|
||||
source = new SourceFileEntry (entry.SourceFile);
|
||||
source_table.Add (entry.SourceFileOffset, source);
|
||||
}
|
||||
|
||||
source.AddMethod (new MethodSourceEntry (
|
||||
i, (int) bw.BaseStream.Position, entry.StartRow, entry.EndRow));
|
||||
|
||||
entry.Write (bw);
|
||||
}
|
||||
ot.method_table_size = (int) bw.BaseStream.Position - ot.method_table_offset;
|
||||
|
||||
//
|
||||
// Write source file table.
|
||||
//
|
||||
ot.source_file_count = source_table.Count;
|
||||
ot.source_file_table_offset = (int) bw.BaseStream.Position;
|
||||
foreach (SourceFileEntry source in source_table.Values)
|
||||
source.Write (bw);
|
||||
ot.source_file_table_size = (int) bw.BaseStream.Position - ot.source_file_table_offset;
|
||||
|
||||
//
|
||||
// Write offset table
|
||||
//
|
||||
ot.type_count = last_type_index;
|
||||
ot.total_file_size = (int) bw.BaseStream.Position;
|
||||
bw.Seek ((int) offset_table_offset, SeekOrigin.Begin);
|
||||
ot.Write (bw);
|
||||
bw.Seek (0, SeekOrigin.End);
|
||||
}
|
||||
|
||||
void IDisposable.Dispose() {
|
||||
Dispose (true);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
bw.Close ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,15 +20,28 @@ using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
internal class SourceFile : SourceFileEntry, ISymbolDocumentWriter
|
||||
internal class SourceFile
|
||||
{
|
||||
private ArrayList _methods = new ArrayList ();
|
||||
private string _file_name;
|
||||
|
||||
public SourceFile (MonoSymbolFile file, string filename)
|
||||
: base (file, filename)
|
||||
{ }
|
||||
public SourceFile (string filename)
|
||||
{
|
||||
this._file_name = filename;
|
||||
}
|
||||
|
||||
public new SourceMethod[] Methods {
|
||||
public override string ToString ()
|
||||
{
|
||||
return _file_name;
|
||||
}
|
||||
|
||||
public string FileName {
|
||||
get {
|
||||
return _file_name;
|
||||
}
|
||||
}
|
||||
|
||||
public SourceMethod[] Methods {
|
||||
get {
|
||||
SourceMethod[] retval = new SourceMethod [_methods.Count];
|
||||
_methods.CopyTo (retval);
|
||||
@@ -40,16 +53,6 @@ namespace Mono.CSharp.Debugger
|
||||
{
|
||||
_methods.Add (method);
|
||||
}
|
||||
|
||||
void ISymbolDocumentWriter.SetCheckSum (Guid algorithmId, byte[] checkSum)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
void ISymbolDocumentWriter.SetSource (byte[] source)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
internal class SourceBlock
|
||||
@@ -57,21 +60,30 @@ namespace Mono.CSharp.Debugger
|
||||
static private int next_index;
|
||||
private readonly int _index;
|
||||
|
||||
public SourceBlock (SourceMethod method, SourceLine start, SourceLine end)
|
||||
{
|
||||
this._method = method;
|
||||
this._start = start;
|
||||
this._end = end;
|
||||
this._index = ++next_index;
|
||||
}
|
||||
|
||||
internal SourceBlock (SourceMethod method, int startOffset)
|
||||
{
|
||||
this._method = method;
|
||||
this._start_offset = startOffset;
|
||||
this._start = new SourceLine (startOffset);
|
||||
this._index = ++next_index;
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return "SourceBlock #" + ID;
|
||||
return "SourceBlock #" + ID + " (" + Start + " - " + End + ")";
|
||||
}
|
||||
|
||||
private readonly SourceMethod _method;
|
||||
private ArrayList _blocks = new ArrayList ();
|
||||
internal int _start_offset, _end_offset;
|
||||
internal SourceLine _start;
|
||||
internal SourceLine _end;
|
||||
|
||||
private ArrayList _locals = new ArrayList ();
|
||||
|
||||
@@ -94,6 +106,18 @@ namespace Mono.CSharp.Debugger
|
||||
_blocks.Add (block);
|
||||
}
|
||||
|
||||
public SourceLine Start {
|
||||
get {
|
||||
return _start;
|
||||
}
|
||||
}
|
||||
|
||||
public SourceLine End {
|
||||
get {
|
||||
return _end;
|
||||
}
|
||||
}
|
||||
|
||||
public int ID {
|
||||
get {
|
||||
return _index;
|
||||
@@ -114,6 +138,63 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
internal class SourceLine
|
||||
{
|
||||
public SourceLine (int row, int column)
|
||||
: this (0, row, column)
|
||||
{
|
||||
this._type = SourceOffsetType.OFFSET_NONE;
|
||||
}
|
||||
|
||||
public SourceLine (int offset, int row, int column)
|
||||
{
|
||||
this._offset = offset;
|
||||
this._row = row;
|
||||
this._column = column;
|
||||
this._type = SourceOffsetType.OFFSET_IL;
|
||||
}
|
||||
|
||||
internal SourceLine (int offset)
|
||||
: this (offset, 0, 0)
|
||||
{ }
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return "SourceLine (" + _offset + "@" + _row + ":" + _column + ")";
|
||||
}
|
||||
|
||||
internal SourceOffsetType _type;
|
||||
internal int _offset;
|
||||
internal int _row;
|
||||
internal int _column;
|
||||
|
||||
// interface SourceLine
|
||||
|
||||
public SourceOffsetType OffsetType {
|
||||
get {
|
||||
return _type;
|
||||
}
|
||||
}
|
||||
|
||||
public int Offset {
|
||||
get {
|
||||
return _offset;
|
||||
}
|
||||
}
|
||||
|
||||
public int Row {
|
||||
get {
|
||||
return _row;
|
||||
}
|
||||
}
|
||||
|
||||
public int Column {
|
||||
get {
|
||||
return _column;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class SourceMethod
|
||||
{
|
||||
private ArrayList _lines = new ArrayList ();
|
||||
@@ -124,25 +205,32 @@ namespace Mono.CSharp.Debugger
|
||||
internal readonly MethodBase _method_base;
|
||||
internal SourceFile _source_file;
|
||||
internal int _token;
|
||||
private int _namespace_id;
|
||||
private LineNumberEntry _start, _end;
|
||||
|
||||
private SourceBlock _implicit_block;
|
||||
|
||||
internal SourceMethod (SourceFile source_file, int startLine, int startColumn,
|
||||
int endLine, int endColumn, MethodBase method_base,
|
||||
int namespace_id)
|
||||
public SourceMethod (MethodBase method_base, SourceFile source_file)
|
||||
: this (method_base)
|
||||
{
|
||||
this._source_file = source_file;
|
||||
}
|
||||
|
||||
internal SourceMethod (MethodBase method_base)
|
||||
{
|
||||
this._method_base = method_base;
|
||||
this._source_file = source_file;
|
||||
this._namespace_id = namespace_id;
|
||||
|
||||
this._start = new LineNumberEntry (startLine, 0);
|
||||
this._end = new LineNumberEntry (endLine, 0);
|
||||
|
||||
this._implicit_block = new SourceBlock (this, 0);
|
||||
}
|
||||
|
||||
public void SetSourceRange (SourceFile sourceFile,
|
||||
int startLine, int startColumn,
|
||||
int endLine, int endColumn)
|
||||
{
|
||||
_source_file = sourceFile;
|
||||
_implicit_block._start = new SourceLine (startLine, startColumn);
|
||||
_implicit_block._end = new SourceLine (endLine, endColumn);
|
||||
}
|
||||
|
||||
|
||||
public void StartBlock (SourceBlock block)
|
||||
{
|
||||
_block_stack.Push (block);
|
||||
@@ -151,7 +239,7 @@ namespace Mono.CSharp.Debugger
|
||||
public void EndBlock (int endOffset) {
|
||||
SourceBlock block = (SourceBlock) _block_stack.Pop ();
|
||||
|
||||
block._end_offset = endOffset;
|
||||
block._end = new SourceLine (endOffset);
|
||||
|
||||
if (_block_stack.Count > 0) {
|
||||
SourceBlock parent = (SourceBlock) _block_stack.Peek ();
|
||||
@@ -166,8 +254,8 @@ namespace Mono.CSharp.Debugger
|
||||
public void SetBlockRange (int BlockID, int startOffset, int endOffset)
|
||||
{
|
||||
SourceBlock block = (SourceBlock) _block_hash [BlockID];
|
||||
block._start_offset = startOffset;
|
||||
block._end_offset = endOffset;
|
||||
((SourceLine) block.Start)._offset = startOffset;
|
||||
((SourceLine) block.End)._offset = endOffset;
|
||||
}
|
||||
|
||||
public SourceBlock CurrentBlock {
|
||||
@@ -179,15 +267,15 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
public LineNumberEntry[] Lines {
|
||||
public SourceLine[] Lines {
|
||||
get {
|
||||
LineNumberEntry[] retval = new LineNumberEntry [_lines.Count];
|
||||
SourceLine[] retval = new SourceLine [_lines.Count];
|
||||
_lines.CopyTo (retval);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddLine (LineNumberEntry line)
|
||||
public void AddLine (SourceLine line)
|
||||
{
|
||||
_lines.Add (line);
|
||||
}
|
||||
@@ -262,39 +350,28 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasSource {
|
||||
public SourceLine Start {
|
||||
get {
|
||||
return _source_file != null;
|
||||
return _implicit_block.Start;
|
||||
}
|
||||
}
|
||||
|
||||
public LineNumberEntry Start {
|
||||
public SourceLine End {
|
||||
get {
|
||||
return _start;
|
||||
}
|
||||
}
|
||||
|
||||
public LineNumberEntry End {
|
||||
get {
|
||||
return _end;
|
||||
}
|
||||
}
|
||||
|
||||
public int NamespaceID {
|
||||
get {
|
||||
return _namespace_id;
|
||||
return _implicit_block.End;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MonoSymbolWriter : IMonoSymbolWriter
|
||||
{
|
||||
protected Assembly assembly;
|
||||
protected ModuleBuilder module_builder;
|
||||
protected ArrayList locals = null;
|
||||
protected ArrayList orphant_methods = null;
|
||||
protected ArrayList methods = null;
|
||||
protected Hashtable sources = null;
|
||||
private MonoSymbolFile file = null;
|
||||
private ArrayList mbuilder_array = null;
|
||||
|
||||
internal SourceMethod[] Methods {
|
||||
get {
|
||||
@@ -313,31 +390,31 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
|
||||
private SourceMethod current_method = null;
|
||||
private string assembly_filename = null;
|
||||
private string output_filename = null;
|
||||
|
||||
//
|
||||
// Interface IMonoSymbolWriter
|
||||
//
|
||||
|
||||
public MonoSymbolWriter (ModuleBuilder mb)
|
||||
public MonoSymbolWriter (ModuleBuilder mb, string filename, ArrayList mbuilder_array)
|
||||
{
|
||||
this.assembly_filename = filename;
|
||||
this.module_builder = mb;
|
||||
this.methods = new ArrayList ();
|
||||
this.sources = new Hashtable ();
|
||||
this.orphant_methods = new ArrayList ();
|
||||
this.locals = new ArrayList ();
|
||||
this.file = new MonoSymbolFile ();
|
||||
this.mbuilder_array = mbuilder_array;
|
||||
}
|
||||
|
||||
public void Close ()
|
||||
{
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
public void Close () {
|
||||
if (assembly == null)
|
||||
assembly = Assembly.LoadFrom (assembly_filename);
|
||||
|
||||
public byte[] CreateSymbolFile (AssemblyBuilder assembly_builder)
|
||||
{
|
||||
DoFixups (assembly_builder);
|
||||
DoFixups (assembly);
|
||||
|
||||
return CreateOutput (assembly_builder);
|
||||
CreateOutput (assembly);
|
||||
}
|
||||
|
||||
public void CloseNamespace () {
|
||||
@@ -349,9 +426,7 @@ namespace Mono.CSharp.Debugger
|
||||
Guid languageVendor,
|
||||
Guid documentType)
|
||||
{
|
||||
SourceFile source_info = new SourceFile (file, url);
|
||||
sources.Add (url, source_info);
|
||||
return source_info;
|
||||
return new MonoSymbolDocumentWriter (url);
|
||||
}
|
||||
|
||||
public void DefineField (
|
||||
@@ -412,17 +487,14 @@ namespace Mono.CSharp.Debugger
|
||||
int[] columns,
|
||||
int[] endLines,
|
||||
int[] endColumns)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void MarkSequencePoint (int offset, int line, int column)
|
||||
{
|
||||
if (current_method == null)
|
||||
return;
|
||||
|
||||
LineNumberEntry source_line = new LineNumberEntry (line, offset);
|
||||
current_method.AddLine (source_line);
|
||||
SourceLine source_line = new SourceLine (offsets [0], lines [0], columns [0]);
|
||||
|
||||
if (current_method != null)
|
||||
current_method.AddLine (source_line);
|
||||
}
|
||||
|
||||
public void Initialize (IntPtr emitter, string filename, bool fFullBuild)
|
||||
@@ -430,9 +502,26 @@ namespace Mono.CSharp.Debugger
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void Initialize (string assembly_filename, string filename, string[] args)
|
||||
{
|
||||
this.output_filename = filename;
|
||||
this.assembly_filename = assembly_filename;
|
||||
}
|
||||
|
||||
public void OpenMethod (SymbolToken symbol_token)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
int token = symbol_token.GetToken ();
|
||||
|
||||
if ((token & 0xff000000) != 0x06000000)
|
||||
throw new ArgumentException ();
|
||||
|
||||
int index = (token & 0xffffff) - 1;
|
||||
|
||||
MethodBuilder mb = (MethodBuilder) mbuilder_array [index];
|
||||
|
||||
current_method = new SourceMethod (mb);
|
||||
|
||||
methods.Add (current_method);
|
||||
}
|
||||
|
||||
public void SetMethodSourceRange (ISymbolDocumentWriter startDoc,
|
||||
@@ -440,21 +529,32 @@ namespace Mono.CSharp.Debugger
|
||||
ISymbolDocumentWriter endDoc,
|
||||
int endLine, int endColumn)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
if (current_method == null)
|
||||
return;
|
||||
|
||||
public void OpenMethod (ISymbolDocumentWriter document, int startLine, int startColumn,
|
||||
int endLine, int endColumn, MethodBase method, int namespace_id)
|
||||
{
|
||||
SourceFile source_info = document as SourceFile;
|
||||
|
||||
if ((source_info == null) || (method == null))
|
||||
if ((startDoc == null) || (endDoc == null))
|
||||
throw new NullReferenceException ();
|
||||
|
||||
current_method = new SourceMethod (source_info, startLine, startColumn,
|
||||
endLine, endColumn, method, namespace_id);
|
||||
if (!(startDoc is MonoSymbolDocumentWriter) || !(endDoc is MonoSymbolDocumentWriter))
|
||||
throw new NotSupportedException ("both startDoc and endDoc must be of type "
|
||||
+ "MonoSymbolDocumentWriter");
|
||||
|
||||
if (!startDoc.Equals (endDoc))
|
||||
throw new NotSupportedException ("startDoc and endDoc must be the same");
|
||||
|
||||
string source_file = ((MonoSymbolDocumentWriter) startDoc).FileName;
|
||||
SourceFile source_info;
|
||||
|
||||
if (sources.ContainsKey (source_file))
|
||||
source_info = (SourceFile) sources [source_file];
|
||||
else {
|
||||
source_info = new SourceFile (source_file);
|
||||
sources.Add (source_file, source_info);
|
||||
}
|
||||
|
||||
current_method.SetSourceRange (source_info, startLine, startColumn,
|
||||
endLine, endColumn);
|
||||
|
||||
methods.Add (current_method);
|
||||
source_info.AddMethod (current_method);
|
||||
}
|
||||
|
||||
@@ -462,19 +562,6 @@ namespace Mono.CSharp.Debugger
|
||||
current_method = null;
|
||||
}
|
||||
|
||||
public int DefineNamespace (string name, ISymbolDocumentWriter document,
|
||||
string[] using_clauses, int parent)
|
||||
{
|
||||
if ((document == null) || (using_clauses == null))
|
||||
throw new NullReferenceException ();
|
||||
if (!(document is SourceFile))
|
||||
throw new ArgumentException ();
|
||||
|
||||
SourceFile source_info = (SourceFile) document;
|
||||
|
||||
return source_info.DefineNamespace (name, using_clauses, parent);
|
||||
}
|
||||
|
||||
public void OpenNamespace (string name)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
@@ -546,21 +633,10 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
protected byte[] CreateOutput (Assembly assembly)
|
||||
protected void CreateOutput (Assembly assembly)
|
||||
{
|
||||
foreach (SourceMethod method in Methods) {
|
||||
if (!method.HasSource) {
|
||||
Console.WriteLine ("INGORING METHOD: {0}", method);
|
||||
continue;
|
||||
}
|
||||
|
||||
method.SourceFile.DefineMethod (
|
||||
method.MethodBase, method.Token, method.Locals,
|
||||
method.Lines, method.Start.Row, method.End.Row,
|
||||
method.NamespaceID);
|
||||
}
|
||||
|
||||
return file.CreateSymbolFile ();
|
||||
using (MonoSymbolTableWriter writer = new MonoSymbolTableWriter (output_filename))
|
||||
writer.WriteSymbolTable (this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
IMonoSymbolWriter.cs
|
||||
MonoSymbolDocumentWriter.cs
|
||||
MonoSymbolWriter.cs
|
||||
MonoSymbolTable.cs
|
||||
MonoSymbolFile.cs
|
||||
MonoSymbolTableWriter.cs
|
||||
IMonoBinaryReader.cs
|
||||
@@ -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,331 +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
|
||||
private DB2ClientParameterCollection parameters = new DB2ClientParameterCollection();
|
||||
|
||||
#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 SelfDescribe property
|
||||
///
|
||||
/// Property dictates whether or not any paramter markers will get their describe info
|
||||
/// from the database, or if the user will supply the information
|
||||
///
|
||||
bool selfDescribe = false;
|
||||
public bool SelfDescribe
|
||||
{
|
||||
get
|
||||
{
|
||||
return selfDescribe;
|
||||
}
|
||||
set
|
||||
{
|
||||
selfDescribe = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region CommandText property
|
||||
///
|
||||
///The query; If it gets set, reset the prepared property
|
||||
///
|
||||
public string CommandText
|
||||
{
|
||||
get
|
||||
{
|
||||
return commandText;
|
||||
}
|
||||
set
|
||||
{
|
||||
prepared = false;
|
||||
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 DB2ClientParameterCollection Parameters
|
||||
{
|
||||
get
|
||||
{
|
||||
return parameters;
|
||||
}
|
||||
}
|
||||
IDataParameterCollection IDbCommand.Parameters
|
||||
{
|
||||
get
|
||||
{
|
||||
return parameters;
|
||||
}
|
||||
}
|
||||
#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()
|
||||
{
|
||||
throw new DB2ClientException("TBD");
|
||||
}
|
||||
#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()
|
||||
{
|
||||
DB2ClientDataReader reader;
|
||||
|
||||
if (!prepared)
|
||||
{
|
||||
ExecuteNonQuery();
|
||||
reader = new DB2ClientDataReader(db2Conn, this);
|
||||
}
|
||||
else
|
||||
reader = new DB2ClientDataReader(db2Conn, this, true);
|
||||
|
||||
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 a statement against the database
|
||||
///
|
||||
public void Prepare ()
|
||||
{
|
||||
DB2ClientUtils util = new DB2ClientUtils();
|
||||
short sqlRet = 0;
|
||||
|
||||
IntPtr numParams = IntPtr.Zero;
|
||||
sqlRet = DB2ClientPrototypes.SQLPrepare(hwndStmt, commandText, commandText.Length);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "SQLPrepare error.");
|
||||
short i=1;
|
||||
foreach ( DB2ClientParameter param in parameters)
|
||||
{
|
||||
if (selfDescribe)
|
||||
{
|
||||
sqlRet = param.Describe(this.hwndStmt, i);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "Error binding parameter in DB2ClientCommand: ");
|
||||
}
|
||||
sqlRet = param.Bind(this.hwndStmt, i);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "Error binding parameter in DB2ClientCommand: ");
|
||||
i++;
|
||||
}
|
||||
prepared=true;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,233 +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()
|
||||
{
|
||||
short sqlRet = 0;
|
||||
// DB2ClientUtils util = new DB2ClientUtils();
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLDisconnect(dbHandle);
|
||||
// util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_DBC, dbHandle, "Error in Connection->Close: ");
|
||||
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,101 +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 int SQL_NTS = -3;
|
||||
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_UNKNOWN_TYPE = 0;
|
||||
public const int SQL_CHAR = 1;
|
||||
public const int SQL_NUMERIC = 2;
|
||||
public const int SQL_DECIMAL = 3;
|
||||
public const int SQL_INTEGER = 4;
|
||||
public const int SQL_SMALLINT = 5;
|
||||
public const int SQL_FLOAT = 6;
|
||||
public const int SQL_REAL = 7;
|
||||
public const int SQL_DOUBLE = 8;
|
||||
public const int SQL_DATETIME = 9;
|
||||
public const int SQL_VARCHAR = 12;
|
||||
public const int SQL_WCHAR = (-8);
|
||||
public const int SQL_WVARCHAR = (-9);
|
||||
public const int SQL_WLONGVARCHAR = (-10);
|
||||
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;
|
||||
public const int SQL_C_DEFAULT = 99;
|
||||
|
||||
public const int SQL_USER_DEFINED_TYPE = (-450);
|
||||
|
||||
/* 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;
|
||||
|
||||
/* Null settings */
|
||||
public const int SQL_NO_NULLS = 0;
|
||||
public const int SQL_NULLABLE = 1;
|
||||
public const int SQL_NULLABLE_UNKNOWN = 2;
|
||||
|
||||
/* Defines for SQLBindParameter and SQLProcedureColumns */
|
||||
public const int SQL_PARAM_TYPE_UNKNOWN = 0;
|
||||
public const int SQL_PARAM_INPUT = 1;
|
||||
public const int SQL_PARAM_INPUT_OUTPUT = 2;
|
||||
public const int SQL_RESULT_COL = 3;
|
||||
public const int SQL_PARAM_OUTPUT = 4;
|
||||
public const int SQL_RETURN_VALUE = 5;
|
||||
}
|
||||
}
|
||||
@@ -1,513 +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;
|
||||
|
||||
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];
|
||||
|
||||
PrepareResults(dbVals, sqlLen_or_IndPtr);
|
||||
FetchResults(dbVals, sqlLen_or_IndPtr, rs);
|
||||
isClosed = false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Constructor for use with prepared statements
|
||||
/// </summary>
|
||||
///
|
||||
internal DB2ClientDataReader(DB2ClientConnection con, DB2ClientCommand com, bool prepared)
|
||||
{
|
||||
db2Conn = con;
|
||||
hwndStmt = com.statementHandle; //We have access to the results through the statement handle
|
||||
|
||||
short sqlRet;
|
||||
|
||||
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];
|
||||
|
||||
PrepareResults(dbVals, sqlLen_or_IndPtr);
|
||||
FetchResults(dbVals, sqlLen_or_IndPtr, rs);
|
||||
isClosed = false;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
#region Describe/Bind/Fetch functions
|
||||
///
|
||||
///Broke these out so that we can use different paths for Immediate executions and Prepared executions
|
||||
/// <summary>
|
||||
/// Does the describe and bind steps for the query result set. Called for both immediate and prepared queries.
|
||||
/// </summary>
|
||||
private void PrepareResults(IntPtr[] dbVals, IntPtr[] sqlLen_or_IndPtr)
|
||||
{
|
||||
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();
|
||||
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((int)colSize+1);
|
||||
|
||||
try
|
||||
{
|
||||
switch ((int)sqlDataType)
|
||||
{
|
||||
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+1, ref sqlLen_or_IndPtr[i-1]);
|
||||
break;
|
||||
default:
|
||||
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, (short)sqlDataType, dbVals[i-1],(short)colSize+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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// FetchResults does what it says.
|
||||
/// </summary>
|
||||
/// <param name="dbVals"></param>
|
||||
/// <param name="sqlLen_or_IndPtr"></param>
|
||||
/// <param name="rs"></param>
|
||||
private void FetchResults(IntPtr[] dbVals, IntPtr[] sqlLen_or_IndPtr, DataTable rs)
|
||||
{
|
||||
short sqlRet = 0;
|
||||
DB2ClientUtils util = new DB2ClientUtils();
|
||||
|
||||
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]);
|
||||
|
||||
rs.Rows.Add(newRow);
|
||||
sqlRet = DB2ClientPrototypes.SQLFetch(hwndStmt);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLFetch 2");
|
||||
}
|
||||
for (int n=0;n<numCols;n++)
|
||||
Marshal.FreeHGlobal(dbVals[n]);
|
||||
}
|
||||
#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
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
@@ -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,365 +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>
|
||||
/// Parameter object for DB2 client
|
||||
/// </summary>
|
||||
public sealed class DB2ClientParameter : MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable
|
||||
{
|
||||
private DbType dbType;
|
||||
private IntPtr db2DataType;
|
||||
private ParameterDirection direction;
|
||||
private bool nullable;
|
||||
private string parameterName;
|
||||
private string sourceColumn;
|
||||
private IntPtr paramSize;
|
||||
private IntPtr decimalDigits;
|
||||
private DataRowVersion sourceVersion;
|
||||
object dataVal;
|
||||
byte[] bDataVal;
|
||||
private int iDataVal;
|
||||
private byte scale, precision;
|
||||
private int size;
|
||||
bool selfDescribe = false;
|
||||
|
||||
#region Contructors and destructors
|
||||
public DB2ClientParameter()
|
||||
{
|
||||
}
|
||||
public DB2ClientParameter (string name)
|
||||
{
|
||||
parameterName = name;
|
||||
}
|
||||
|
||||
public DB2ClientParameter(string name, DbType type)
|
||||
{
|
||||
parameterName = name;
|
||||
dbType = type;
|
||||
}
|
||||
public DB2ClientParameter(string name, object data)
|
||||
{
|
||||
parameterName = name;
|
||||
this.Value = data;
|
||||
}
|
||||
public DB2ClientParameter(string name, DbType type, string columnName)
|
||||
{
|
||||
parameterName = name;
|
||||
dbType = type;
|
||||
sourceColumn = columnName;
|
||||
}
|
||||
public DB2ClientParameter(string name, int db2Type)
|
||||
{
|
||||
parameterName = name;
|
||||
dbType = inferTypeFromDB2Type(db2Type);
|
||||
db2DataType = new IntPtr(db2Type);
|
||||
}
|
||||
#endregion
|
||||
#region Properties
|
||||
#region DbType Property
|
||||
///
|
||||
/// Parameter data type
|
||||
///
|
||||
public DbType DbType
|
||||
{
|
||||
get
|
||||
{
|
||||
return dbType;
|
||||
}
|
||||
set
|
||||
{
|
||||
dbType = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Direction
|
||||
///
|
||||
/// In or out parameter, or both
|
||||
///
|
||||
public ParameterDirection Direction
|
||||
{
|
||||
get
|
||||
{
|
||||
return direction;
|
||||
}
|
||||
set
|
||||
{
|
||||
direction = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region IsNullable
|
||||
///
|
||||
/// Does this parameter support a null value
|
||||
///
|
||||
public bool IsNullable
|
||||
{
|
||||
get
|
||||
{
|
||||
return nullable;
|
||||
}
|
||||
set
|
||||
{
|
||||
nullable = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region ParameterName
|
||||
public string ParameterName
|
||||
{
|
||||
get
|
||||
{
|
||||
return parameterName;
|
||||
}
|
||||
set
|
||||
{
|
||||
parameterName = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region SourceColumn
|
||||
///
|
||||
/// Gets or sets the name of the source column that is mapped to the DataSet
|
||||
///
|
||||
public string SourceColumn
|
||||
{
|
||||
get
|
||||
{
|
||||
return sourceColumn;
|
||||
}
|
||||
set
|
||||
{
|
||||
sourceColumn = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region SourceVersion
|
||||
///
|
||||
/// DataRowVersion property
|
||||
///
|
||||
public DataRowVersion SourceVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return sourceVersion;
|
||||
}
|
||||
set
|
||||
{
|
||||
sourceVersion = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region IDbDataParameter properties
|
||||
public byte Precision
|
||||
{
|
||||
get
|
||||
{
|
||||
return precision;
|
||||
}
|
||||
set
|
||||
{
|
||||
precision = value;
|
||||
}
|
||||
}
|
||||
|
||||
public byte Scale
|
||||
{
|
||||
get
|
||||
{
|
||||
return scale;
|
||||
}
|
||||
set
|
||||
{
|
||||
scale = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Size
|
||||
{
|
||||
get
|
||||
{
|
||||
return size;
|
||||
}
|
||||
set
|
||||
{
|
||||
size = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Value
|
||||
///
|
||||
/// The actual parameter data
|
||||
///
|
||||
public object Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.dataVal = value;
|
||||
DbType = inferType(dataVal);
|
||||
// Load buffer with new value
|
||||
if (dbType==DbType.Int32)
|
||||
iDataVal=(int) value;
|
||||
else
|
||||
{
|
||||
// Treat everything else as a string
|
||||
// Init string buffer
|
||||
if (bDataVal==null || bDataVal.Length< (((int)paramSize>20)?(int)paramSize:20) )
|
||||
bDataVal=new byte[((int)paramSize>20)?(int)paramSize:20];
|
||||
else
|
||||
bDataVal.Initialize();
|
||||
// Convert value into string and store into buffer
|
||||
byte[] strValueBuffer=System.Text.Encoding.ASCII.GetBytes(dataVal.ToString());
|
||||
strValueBuffer.CopyTo(bDataVal,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
#region inferType Method
|
||||
/// <summary>
|
||||
/// Determine the data type based on the value
|
||||
/// </summary>
|
||||
private DbType inferType (object Data)
|
||||
{
|
||||
switch (Type.GetTypeCode(Data.GetType()))
|
||||
{
|
||||
case TypeCode.Empty:
|
||||
throw new SystemException("Invalid data type");
|
||||
|
||||
case TypeCode.Object:
|
||||
return DbType.Object;
|
||||
|
||||
case TypeCode.DBNull:
|
||||
case TypeCode.Char:
|
||||
case TypeCode.SByte:
|
||||
case TypeCode.UInt16:
|
||||
case TypeCode.UInt32:
|
||||
case TypeCode.UInt64:
|
||||
// Throw a SystemException for unsupported data types.
|
||||
throw new SystemException("Invalid data type");
|
||||
|
||||
case TypeCode.Boolean:
|
||||
return DbType.Boolean;
|
||||
|
||||
case TypeCode.Byte:
|
||||
return DbType.Byte;
|
||||
|
||||
case TypeCode.Int16:
|
||||
return DbType.Int16;
|
||||
|
||||
case TypeCode.Int32:
|
||||
return DbType.Int32;
|
||||
|
||||
case TypeCode.Int64:
|
||||
return DbType.Int64;
|
||||
|
||||
case TypeCode.Single:
|
||||
return DbType.Single;
|
||||
|
||||
case TypeCode.Double:
|
||||
return DbType.Double;
|
||||
|
||||
case TypeCode.Decimal:
|
||||
return DbType.Decimal;
|
||||
|
||||
case TypeCode.DateTime:
|
||||
return DbType.DateTime;
|
||||
|
||||
case TypeCode.String:
|
||||
return DbType.String;
|
||||
|
||||
default:
|
||||
throw new SystemException("Value is of unknown data type");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region inferTypeFromDB2Type
|
||||
///
|
||||
/// Determine the DbType from the SQL type returned by SQLDescribeParam
|
||||
///
|
||||
private DbType inferTypeFromDB2Type(int db2Type)
|
||||
{
|
||||
switch (db2Type)
|
||||
{
|
||||
case DB2ClientConstants.SQL_CHAR:
|
||||
return DbType.AnsiString;
|
||||
case DB2ClientConstants.SQL_NUMERIC:
|
||||
case DB2ClientConstants.SQL_DECIMAL:
|
||||
return DbType.Decimal;
|
||||
case DB2ClientConstants.SQL_DATETIME:
|
||||
return DbType.DateTime;
|
||||
case DB2ClientConstants.SQL_FLOAT:
|
||||
case DB2ClientConstants.SQL_DOUBLE:
|
||||
return DbType.Double;
|
||||
case DB2ClientConstants.SQL_INTEGER:
|
||||
return DbType.Int32;
|
||||
case DB2ClientConstants.SQL_SMALLINT:
|
||||
return DbType.Int16;
|
||||
case DB2ClientConstants.SQL_VARCHAR:
|
||||
return DbType.String;
|
||||
case DB2ClientConstants.SQL_USER_DEFINED_TYPE:
|
||||
return DbType.Object;
|
||||
default:
|
||||
throw new SystemException("DB2 Data type is unknown.");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Describe
|
||||
///
|
||||
/// Describe the parameter. Use at the caller's discretion
|
||||
///
|
||||
public short Describe(IntPtr hwndStmt, short paramNum)
|
||||
{
|
||||
IntPtr nullable = IntPtr.Zero;
|
||||
paramSize = IntPtr.Zero;
|
||||
decimalDigits = IntPtr.Zero;
|
||||
short sqlRet = 0;
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLDescribeParam(hwndStmt, paramNum, ref db2DataType, ref paramSize, ref decimalDigits, ref nullable);
|
||||
return sqlRet;
|
||||
}
|
||||
#endregion
|
||||
#region Bind
|
||||
///
|
||||
/// Bind this parameter
|
||||
///
|
||||
public short Bind(IntPtr hwndStmt, short paramNum)
|
||||
{
|
||||
short sqlRet = 0;
|
||||
|
||||
switch ((int)db2DataType)
|
||||
{
|
||||
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:
|
||||
case DB2ClientConstants.SQL_CHAR:
|
||||
sqlRet = DB2ClientPrototypes.SQLBindParameter(hwndStmt, (ushort)paramNum, DB2ClientConstants.SQL_PARAM_INPUT, DB2ClientConstants.SQL_C_DEFAULT, (short)db2DataType, Convert.ToUInt32((int)paramSize) , (short) decimalDigits, bDataVal, 0, 0);
|
||||
break;
|
||||
default:
|
||||
sqlRet = DB2ClientPrototypes.SQLBindParameter(hwndStmt, (ushort)paramNum, DB2ClientConstants.SQL_PARAM_INPUT, DB2ClientConstants.SQL_C_DEFAULT, (short)db2DataType, Convert.ToUInt32((int)paramSize) , 0, ref iDataVal, 0, 0);
|
||||
break;
|
||||
}
|
||||
return sqlRet;
|
||||
}
|
||||
#endregion
|
||||
object ICloneable.Clone ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,93 +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.Collections;
|
||||
using System.Globalization;
|
||||
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for DB2ClientParameterCollection.
|
||||
/// </summary>
|
||||
public class DB2ClientParameterCollection : ArrayList, IDataParameterCollection
|
||||
{
|
||||
public object this[string index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return this[IndexOf(index)];
|
||||
}
|
||||
set
|
||||
{
|
||||
this[IndexOf(index)] = value;
|
||||
}
|
||||
}
|
||||
public bool Contains(string paramName)
|
||||
{
|
||||
return(-1 != IndexOf(paramName));
|
||||
}
|
||||
|
||||
public int IndexOf(string paramName)
|
||||
{
|
||||
int index = 0;
|
||||
foreach(DB2ClientParameter item in this)
|
||||
{
|
||||
if (0 == _cultureAwareCompare(item.ParameterName, paramName))
|
||||
{
|
||||
return index;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void RemoveAt(string paramName)
|
||||
{
|
||||
RemoveAt(IndexOf(paramName));
|
||||
}
|
||||
|
||||
public override int Add(object value)
|
||||
{
|
||||
return Add((DB2ClientParameter)value);
|
||||
}
|
||||
|
||||
public int Add(DB2ClientParameter value)
|
||||
{
|
||||
if (((DB2ClientParameter)value).ParameterName != null)
|
||||
{
|
||||
return base.Add(value);
|
||||
}
|
||||
else
|
||||
throw new ArgumentException("parameter must be named");
|
||||
}
|
||||
|
||||
public int Add(string paramName, DbType type)
|
||||
{
|
||||
return Add(new DB2ClientParameter(paramName, type));
|
||||
}
|
||||
|
||||
public int Add(string paramName, object value)
|
||||
{
|
||||
return Add(new DB2ClientParameter(paramName, value));
|
||||
}
|
||||
|
||||
public int Add(string paramName, DbType dbType, string sourceColumn)
|
||||
{
|
||||
return Add(new DB2ClientParameter(paramName, dbType, sourceColumn));
|
||||
}
|
||||
|
||||
private int _cultureAwareCompare(string strA, string strB)
|
||||
{
|
||||
return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,68 +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>
|
||||
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, [In] IntPtr sqlValuePtr, long sqlValueLength);
|
||||
[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);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLPrepare")]
|
||||
unsafe public static extern short SQLPrepare(IntPtr stmtHandle, string stmt, int length);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLDescribeParam")]
|
||||
unsafe public static extern short SQLDescribeParam(IntPtr stmtHandle, short paramNumber,ref IntPtr dataType, ref IntPtr paramSize, ref IntPtr decimalDigits, ref IntPtr nullable);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLNumParams")]
|
||||
unsafe public static extern short SQLNumParams(IntPtr stmtHandle, ref IntPtr numParams);
|
||||
[DllImport("db2cli.dll")]
|
||||
internal static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber,
|
||||
short dataType, short valueType, short paramType, uint colSize, short decDigits,
|
||||
byte[] dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLBindParameter")]
|
||||
unsafe public static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber,
|
||||
short dataType, short valueType, short paramType, uint colSize, short decDigits,
|
||||
ref int dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,105 +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>
|
||||
/// 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.
|
||||
/// NOTE: AT THE MOMENT, SETTING OF THE ISOLATION LEVEL IS NOT WORKING
|
||||
/// </summary>
|
||||
unsafe public class DB2ClientTransaction : IDbTransaction
|
||||
{
|
||||
DB2ClientUtils util = new DB2ClientUtils();
|
||||
IsolationLevel IL = IsolationLevel.Unspecified;
|
||||
DB2ClientConnection db2Conn;
|
||||
public DB2ClientTransaction(DB2ClientConnection con, IsolationLevel isoL)
|
||||
{
|
||||
long db2IsoL = DB2ClientConstants.SQL_TXN_READ_COMMITTED;
|
||||
db2Conn = con;
|
||||
short sqlRet;
|
||||
|
||||
switch (isoL)
|
||||
{
|
||||
case System.Data.IsolationLevel.Chaos: //No DB2equivalent, default to SQL_TXN_READ_COMMITTED
|
||||
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;
|
||||
}
|
||||
|
||||
IL = isoL;
|
||||
IntPtr iso = new IntPtr(db2IsoL);
|
||||
IntPtr attr = new IntPtr(DB2ClientConstants.SQL_AUTOCOMMIT_OFF);
|
||||
sqlRet = DB2ClientPrototypes.SQLSetConnectAttr(db2Conn.DBHandle, DB2ClientConstants.SQL_AUTOCOMMIT, attr, 0);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, "Error setting AUTOCOMMIT OFF in transaction CTOR.");
|
||||
// sqlRet = DB2ClientPrototypes.SQLSetConnectAttr(db2Conn.DBHandle, DB2ClientConstants.SQL_TXN_ISOLATION, iso, 0);
|
||||
// util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, "Error setting TRANSCTION ISOLATION in transaction CTOR.");
|
||||
|
||||
}
|
||||
|
||||
/// <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
|
||||
}
|
||||
}
|
||||
Loaded 100 of 1279 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user