+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
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;
}
public string Message {
get {
- return errorMessage;
+ return message;
}
}
public string Source {
get {
- return errorSource;
+ return source;
}
}
String stackTrace;
stackTrace = " <Stack Trace>";
// FIXME: generate the correct SQL error string
- toStr = "OleDbError:" + errorMessage + stackTrace;
- return toStr;
+ toStr = "OleDbError:" + message + stackTrace;
+ return toStr;
}
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;
}
}
internal void Add (OleDbError error)
{
- list.Add ((object) error);
+ items.Add ((object) error);
}
public void CopyTo (Array array, int index)
// 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 ()