SqlInfoMessageEvent.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //------------------------------------------------------------------------------
  2. // <copyright file="SqlInfoMessageEvent.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. public sealed class SqlInfoMessageEventArgs : System.EventArgs {
  11. private SqlException exception;
  12. internal SqlInfoMessageEventArgs(SqlException exception) {
  13. this.exception = exception;
  14. }
  15. public SqlErrorCollection Errors {
  16. get { return exception.Errors;}
  17. }
  18. /*virtual protected*/private bool ShouldSerializeErrors() { // MDAC 65548
  19. return (null != exception) && (0 < exception.Errors.Count);
  20. }
  21. public string Message { // MDAC 68482
  22. get { return exception.Message; }
  23. }
  24. public string Source { // MDAC 68482
  25. get { return exception.Source;}
  26. }
  27. override public string ToString() { // MDAC 68482
  28. return Message;
  29. }
  30. }
  31. }