X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=web%2Fado-net;h=0095d79ef79996374030641fce45c5c8a01272ac;hb=a17adea98d0e3b4b130ba2d3c65521c26e7f32a7;hp=6eced795105fd3631af4061c4d5bb94ea10f2695;hpb=451af388d71c4393a779fd30ea01a3264084961b;p=mono.git diff --git a/web/ado-net b/web/ado-net index 6eced795105..0095d79ef79 100644 --- a/web/ado-net +++ b/web/ado-net @@ -1,278 +1,198 @@ * ADO.NET - The coordinator for the ADO.NET implementation is - Rodrigo Moya, - with the collaboration of: - Daniel Morgan, - Tim Coleman, - Brian Ritchie, and - Vladimir Vukicevic. +** Data Access in Mono + + -* Action plan - -

The current plan to implement ADO.NET is as follows: +** Bugs and Feature Requests -

-

ADO.NET Multiplexor Provider needs to be created. It can use the - ADO.NET Provider Factory to create its connections and adapters, but the - Multiplexor Provider is a Generic Provider that internally uses an existing - provider based on configuration options. This is not - part of Microsoft .NET, but it needs to be able to run on Microsoft .NET - and Mono. This provider can be a generic provider, much like the ODBC.NET and - OLEDB.NET providers are, but be written in 100% C# and be configurable via - a configuration file. This provider will multiplex to other providers - that exist. If one does not exist for a given DBMS, - default to the ODBC or OLEDB .NET provider. +** ADO.NET Data Providers -

According to Gonzalo, this is how the configuration could be implemented for - the Provider Factory and Multiplexor Provider. +

Mono has many ADO.NET Data Providers to get you connected: + +

-

After some work done in System.Configuration, you can now do something - like: +

External Projects that have created ADO.NET Providers that work on Mono: -

-

- // Get an instance of the multiplexor from machine.config file
- // Can be overriden in the application config file	
- object o = ConnectionSettings.GetConfig 
-               ("mono.data/multiplexor");
- if (o == null)
-	--- error
-    
- Multiplexor mp = (Multiplexor) o;
-    
- // may be a string [] argument can help passing arguments
- IDbConnection cnc = mp.CreateConnection (providerName);
-
+ -
-  <configuration>
-   <configSections>
-    <section name="mono.data"
-      type="Mono.Data.MultiplexorSectionHandler,Mono.Data"/>
-    ....
-   </configSections>
-   ...
-   <sectionGroup name="mono.data">
-     <multiplexor>
-       <add provider="PostgreSQL" 
-          type="Mono.Data.PostgreSQLClient,Mono.Data"
-          validate="false" 
-          parameters="USER=xxx;HOST=127.0.0.1;DBNAME=xxx"/>
-     </multiplexor>
-   </sectionGroup>
-  </configuration>
-
+** Tools -

validate="false" tells MultiplexorSectionHandler not to load the Type - until an instance is required. You can add more attributes or whatever - inside as long as MultiplexorSectionHandler parses it. +

Some tools that can be used for ADO.NET and other technologies (ASP.NET, XML, etc). -

-public class MultiplexorSectionHandler :
-IConfigurationSectionHandler
-{
-    public object Create (object parent, 
-      object configContext,
-      XmlNode section)
-    {
-       Multiplexor mp;
-       // Here you get the ChildNodes and 
-       // set up a Multiplexor
-       // instance that will hold the information 
-       // needed to create 
-       // instances of each provider. Only one 
-       // instance will be 
-       // created by the config system.
-            return mp;
-    }
- }
-
-

This way, if our providers works with MS, the user can test them in both - MS and mono by just adding a few lines to machine.config (i still have - to upload a default machine.config file for mono). And this is the .NET - way of doing it (of course, if you prefer, you can use the other config - file. I just wanted to make people aware of this feature that now works - on mono). - -

Building System.Data - -

The System.Data.dll gets built with the rest of the class library. - To compile the System.Data.dll assembly separately, you need: +

- On Unix +** Extra Classes in Mono ADO.NET +

An ADO.NET Provider Factory + was created by Brian Ritchie. The + Provider Factory is a way to dynamically create + connections, commands, parameters, and data adapters based on configuration + information. + +** Database Access from ASP.NET

- On Windows - -