From: Rodrigo Moya Date: Sun, 18 Aug 2002 12:47:50 +0000 (-0000) Subject: 2002-08-18 Rodrigo Moya X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=0624655c6e4b9172b2097213c03459b0aff86e41;p=mono.git 2002-08-18 Rodrigo Moya * 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 --- diff --git a/mcs/class/System.Data/ChangeLog b/mcs/class/System.Data/ChangeLog index 87ab20fc257..2eb2746f1c2 100644 --- a/mcs/class/System.Data/ChangeLog +++ b/mcs/class/System.Data/ChangeLog @@ -1,3 +1,12 @@ +2002-08-18 Rodrigo Moya + + * 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 * System.Data.OleDb/TestOleDb.cs: made it work with a temporary table diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs index fdf8d785538..7ac711a59ae 100644 --- a/mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs +++ b/mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs @@ -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) diff --git a/mcs/class/System.Data/System.Data.OleDb/libgda.cs b/mcs/class/System.Data/System.Data.OleDb/libgda.cs index 070c3fbc868..bbe6778737f 100644 --- a/mcs/class/System.Data/System.Data.OleDb/libgda.cs +++ b/mcs/class/System.Data/System.Data.OleDb/libgda.cs @@ -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);