OdbcError.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //------------------------------------------------------------------------------
  2. // <copyright file="OdbcError.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. using System;
  9. using System.Data;
  10. namespace System.Data.Odbc
  11. {
  12. [Serializable]
  13. public sealed class OdbcError {
  14. //Data
  15. internal string _message;
  16. internal string _state;
  17. internal int _nativeerror;
  18. internal string _source;
  19. internal OdbcError(string source, string message, string state, int nativeerror) {
  20. _source = source;
  21. _message = message;
  22. _state = state;
  23. _nativeerror= nativeerror;
  24. }
  25. public string Message {
  26. get {
  27. return ((null != _message) ? _message : String.Empty);
  28. }
  29. }
  30. public string SQLState {
  31. get {
  32. return _state;
  33. }
  34. }
  35. public int NativeError {
  36. get {
  37. return _nativeerror;
  38. }
  39. }
  40. public string Source {
  41. get {
  42. return ((null != _source) ? _source : String.Empty);
  43. }
  44. }
  45. internal void SetSource (string Source) {
  46. _source = Source;
  47. }
  48. override public string ToString() {
  49. return Message;
  50. }
  51. }
  52. }