* OleDbError.cs: fixed serialization compatibility with MS.NET
authorGert Driesen <drieseng@users.sourceforge.net>
Fri, 18 Jun 2004 15:38:10 +0000 (15:38 -0000)
committerGert Driesen <drieseng@users.sourceforge.net>
Fri, 18 Jun 2004 15:38:10 +0000 (15:38 -0000)
* OleDbErrorCollection.cs: fixed serialization compatibility with
MS.NET

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

mcs/class/System.Data/System.Data.OleDb/ChangeLog
mcs/class/System.Data/System.Data.OleDb/OleDbError.cs
mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs

index c2f842076dfe928b920b3b726c1794bf71160be7..763694a6941b02f914f075ff350d79970900295b 100644 (file)
@@ -1,3 +1,9 @@
+2004-06-16  Gert Driesen <drieseng@users.sourceforge.net>
+
+       * OleDbError.cs: fixed serialization compatibility with MS.NET
+       * OleDbErrorCollection.cs: fixed serialization compatibility with
+       MS.NET
+
 2004-06-13  Gert Driesen <drieseng@users.sourceforge.net>
 
        * OleDbLiteral.cs: changed enum field values to match MS.NET
index 2242550cabbca750d38162e7436c07131c9a76ee..2497c3d8c75f02f1f39f7b3e17744d2e10390cd0 100644 (file)
@@ -37,20 +37,21 @@ using System.Data.Common;
 
 namespace System.Data.OleDb
 {
+       [Serializable]
        public sealed class OleDbError
        {
-               private string errorMessage;
+               private string message;
                private int nativeError;
-               private string errorSource;
+               private string source;
                private string sqlState;
 
                #region Constructors
 
                internal OleDbError (string msg, int code, string source, string sql)
                {
-                       errorMessage = msg;
+                       message = msg;
                        nativeError = code;
-                       errorSource = source;
+                       this.source = source;
                        sqlState = sql;
                }
                
@@ -60,7 +61,7 @@ namespace System.Data.OleDb
 
                public string Message {
                        get {
-                               return errorMessage;
+                               return message;
                        }
                }
 
@@ -72,7 +73,7 @@ namespace System.Data.OleDb
 
                public string Source {
                        get {
-                               return errorSource;
+                               return source;
                        }
                }
 
@@ -93,8 +94,8 @@ namespace System.Data.OleDb
                         String stackTrace;
                         stackTrace = " <Stack Trace>";
                         // FIXME: generate the correct SQL error string
-                        toStr = "OleDbError:" + errorMessage + stackTrace;
-                        return toStr;
+                       toStr = "OleDbError:" + message + stackTrace;
+                       return toStr;
 
                }
 
index 08362b77cb4d5ba384256830a20fbacd795bab6d..af50d07f4cafd087561b915e3ad364058c9fa70e 100644 (file)
@@ -39,46 +39,46 @@ using System.Data.Common;
 
 namespace System.Data.OleDb
 {
-       [ListBindableAttribute ( false)]        
-
+       [ListBindableAttribute ( false)]
+       [Serializable]
        public sealed class OleDbErrorCollection : ICollection, IEnumerable
        {
                #region Fields
 
-               ArrayList list;
+               ArrayList items;
        
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               internal OleDbErrorCollection() {\r
-               }\r
-\r
+               #endregion // Fields
+
+               #region Constructors
+
+               internal OleDbErrorCollection() {
+               }
+
                #endregion Constructors
 
                #region Properties 
 
                public int Count {
                        get {
-                               return list.Count;
+                               return items.Count;
                        }
                }
 
                public OleDbError this[int index] {
                        get {
-                               return (OleDbError) list[index];
+                               return (OleDbError) items[index];
                        }
                }
 
                object ICollection.SyncRoot {
                        get {
-                               return list.SyncRoot;
+                               return items.SyncRoot;
                        }
                }
 
                bool ICollection.IsSynchronized {
                        get {
-                               return list.IsSynchronized;
+                               return items.IsSynchronized;
                        }
                }
 
@@ -88,7 +88,7 @@ namespace System.Data.OleDb
 
                internal void Add (OleDbError error)
                {
-                       list.Add ((object) error);
+                       items.Add ((object) error);
                }
                
                public void CopyTo (Array array, int index) 
@@ -102,15 +102,15 @@ namespace System.Data.OleDb
                         // is the check for IsFixedSize required?
                         if ((array.IsFixedSize) || (index + this.Count > array.GetUpperBound (0)))
                                 throw new ArgumentException("array");
-                                                                                                    
-                        ((OleDbError[])(list.ToArray ())).CopyTo (array, index);
-                                                                                                    
+
+                       ((OleDbError[]) (items.ToArray ())).CopyTo (array, index);
+
 
                }
 
                public IEnumerator GetEnumerator ()
                {
-                       return list.GetEnumerator ();
+                       return items.GetEnumerator ();
                }
 
                IEnumerator IEnumerable.GetEnumerator ()