SqlErrorCollection.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //------------------------------------------------------------------------------
  2. // <copyright file="SqlErrorCollection.cs" company="Microsoft">
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. // </copyright>
  5. // <owner current="true" primary="true">[....]</owner>
  6. // <owner current="true" primary="false">[....]</owner>
  7. //------------------------------------------------------------------------------
  8. namespace System.Data.SqlClient {
  9. using System;
  10. using System.Collections;
  11. using System.ComponentModel;
  12. using System.Diagnostics;
  13. using System.Runtime.InteropServices;
  14. [Serializable, ListBindable(false)]
  15. public sealed class SqlErrorCollection : ICollection {
  16. private ArrayList errors = new ArrayList();
  17. internal SqlErrorCollection() {
  18. }
  19. public void CopyTo (Array array, int index) {
  20. this.errors.CopyTo(array, index);
  21. }
  22. public void CopyTo (SqlError[] array, int index) {
  23. this.errors.CopyTo(array, index);
  24. }
  25. public int Count {
  26. get { return this.errors.Count;}
  27. }
  28. object System.Collections.ICollection.SyncRoot { // MDAC 68481
  29. get { return this;}
  30. }
  31. bool System.Collections.ICollection.IsSynchronized { // MDAC 68481
  32. get { return false;}
  33. }
  34. public SqlError this[int index] {
  35. get {
  36. return (SqlError) this.errors[index];
  37. }
  38. }
  39. public IEnumerator GetEnumerator() {
  40. return errors.GetEnumerator();
  41. }
  42. internal void Add(SqlError error) {
  43. this.errors.Add(error);
  44. }
  45. }
  46. }