diff options
author | Umadevi S <uma@mono-cvs.ximian.com> | 2004-03-23 13:41:16 +0300 |
---|---|---|
committer | Umadevi S <uma@mono-cvs.ximian.com> | 2004-03-23 13:41:16 +0300 |
commit | 3dd5e6fe1a68aa0bd3980f2752e13f4efcca6d2c (patch) | |
tree | 0af52333c4a014b763541d0ba58d2b00498c32ae /mcs/class/System.Data/System.Data.OleDb | |
parent | bb8fe26a6ec8fca5deb935c2e41c80f94ac55f5b (diff) |
2004-03-23 Umadevi S (sumadevi@novell.com)
* implemented Attributes, methods in OleDbError.cs & OleDbErrorCollection.cs
svn path=/trunk/mcs/; revision=24453
Diffstat (limited to 'mcs/class/System.Data/System.Data.OleDb')
-rw-r--r-- | mcs/class/System.Data/System.Data.OleDb/OleDbError.cs | 12 | ||||
-rw-r--r-- | mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs | 19 |
2 files changed, 25 insertions, 6 deletions
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbError.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbError.cs index b672820a095..d3f6b79f51f 100644 --- a/mcs/class/System.Data/System.Data.OleDb/OleDbError.cs +++ b/mcs/class/System.Data/System.Data.OleDb/OleDbError.cs @@ -53,7 +53,7 @@ namespace System.Data.OleDb } } - public string SqlState { + public string SQLState { get { return sqlState; } @@ -62,11 +62,17 @@ namespace System.Data.OleDb #endregion #region Methods - + [MonoTODO] public override string ToString () { - throw new NotImplementedException (); + string toStr; + String stackTrace; + stackTrace = " <Stack Trace>"; + // FIXME: generate the correct SQL error string + toStr = "OleDbError:" + errorMessage + stackTrace; + return toStr; + } #endregion diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs index 8768459bc2e..4384e04f002 100644 --- a/mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs +++ b/mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs @@ -10,11 +10,14 @@ // using System.Collections; +using System.ComponentModel; using System.Data; using System.Data.Common; namespace System.Data.OleDb { + [ListBindableAttribute ( false)] + public sealed class OleDbErrorCollection : ICollection, IEnumerable { #region Fields @@ -58,11 +61,21 @@ namespace System.Data.OleDb list.Add ((object) error); } - [MonoTODO] public void CopyTo (Array array, int index) { - ((OleDbError[])(list.ToArray ())).CopyTo (array, index); - throw new NotImplementedException (); + if (array == null) + throw new ArgumentNullException("array"); + + if ((index < array.GetLowerBound (0)) || (index > array.GetUpperBound (0))) + throw new ArgumentOutOfRangeException("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); + + } public IEnumerator GetEnumerator () |