2002-08-18 Rodrigo Moya <rodrigo@ximian.com>
authorRodrigo Moya <rodrigo@mono-cvs.ximian.com>
Sun, 18 Aug 2002 12:47:50 +0000 (12:47 -0000)
committerRodrigo Moya <rodrigo@mono-cvs.ximian.com>
Sun, 18 Aug 2002 12:47:50 +0000 (12:47 -0000)
* System.Data.OleDb/OleDbDataReader.cs (this[]): made it just call
GetValue, which will take care of all the work needed.
(Close): implemented basic stuff.
(~OleDbDataReader): implemented.

* System.Data.OleDb/libgda.cs: added more needed functions.

svn path=/trunk/mcs/; revision=6721

mcs/class/System.Data/ChangeLog
mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs
mcs/class/System.Data/System.Data.OleDb/libgda.cs

index 87ab20fc2571ef44afc5932eddd2e49b68faf7ab..2eb2746f1c214f37ced66ff3e7da7a1660373a52 100644 (file)
@@ -1,3 +1,12 @@
+2002-08-18  Rodrigo Moya <rodrigo@ximian.com>
+
+       * System.Data.OleDb/OleDbDataReader.cs (this[]): made it just call
+       GetValue, which will take care of all the work needed.
+       (Close): implemented basic stuff.
+       (~OleDbDataReader): implemented.
+
+       * System.Data.OleDb/libgda.cs: added more needed functions.
+
 2002-08-16  Rodrigo Moya <rodrigo@ximian.com>
 
        * System.Data.OleDb/TestOleDb.cs: made it work with a temporary table
index fdf8d78553825986fe8a915a2c100e710b6e5ca0..7ac711a59aeba4b47eef3781a111d5f31a508fe2 100644 (file)
@@ -79,14 +79,7 @@ namespace System.Data.OleDb
 
                public object this[int index] {
                        get {
-                               if (currentResult < 0 ||
-                                   currentResult >= gdaResults.Count)
-                                       return null;
-                               
-                               return libgda.gda_data_model_get_value_at (
-                                               (IntPtr) gdaResults[currentResult],
-                                               index,
-                                               currentRow);
+                               return (object) GetValue (index);
                        }
                }
 
@@ -115,16 +108,23 @@ namespace System.Data.OleDb
 
                #region Methods
 
-               [MonoTODO]
                public void Close ()
                {
-                       throw new NotImplementedException ();
+                       for (int i = 0; i < gdaResults.Count; i++) {
+                               IntPtr obj = (IntPtr) gdaResults[i];
+                               libgda.FreeObject (obj);
+                               gdaResults = null;
+                       }
+                       
+                       open = false;
+                       currentResult = -1;
+                       currentRow = -1;
                }
 
-               [MonoTODO]
                ~OleDbDataReader ()
                {
-                       throw new NotImplementedException ();
+                       if (open)
+                               Close ();
                }
 
                public bool GetBoolean (int ordinal)
index 070c3fbc868a54e89215edc8fd35c8d0beef633e..bbe6778737fb3dfd74e545ead2a8444e9e0e121f 100644 (file)
@@ -72,7 +72,11 @@ namespace System.Data.OleDb
                                return gdaClient;
                        }
                }
-               
+
+               [DllImport("gobject-2.0",
+                          EntryPoint="g_object_unref")]
+               public static extern void FreeObject (IntPtr obj);
+
                [DllImport("gda-2")]
                public static extern void gda_init (string app_id, string version, int nargs, string[] args);