SqlDataAdapter.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //
  2. // System.Data.SqlClient.SqlDataAdapter.cs
  3. //
  4. // Author:
  5. // Rodrigo Moya ([email protected])
  6. // Daniel Morgan ([email protected])
  7. // Tim Coleman ([email protected])
  8. //
  9. // (C) Ximian, Inc 2002
  10. // Copyright (C) 2002 Tim Coleman
  11. //
  12. using System;
  13. using System.ComponentModel;
  14. using System.Data;
  15. using System.Data.Common;
  16. namespace System.Data.SqlClient
  17. {
  18. /// <summary>
  19. /// Represents a set of command-related properties that are used
  20. /// to fill the DataSet and update a data source, all this
  21. /// from a SQL database.
  22. /// </summary>
  23. public sealed class SqlDataAdapter : DbDataAdapter
  24. {
  25. #region Constructors
  26. public SqlDataAdapter ()
  27. : this (new SqlCommand ())
  28. {
  29. }
  30. public SqlDataAdapter (SqlCommand selectCommand)
  31. {
  32. this.deleteCommand = new SqlCommand ();
  33. this.insertCommand = new SqlCommand ();
  34. this.selectCommand = selectCommand;
  35. this.updateCommand = new SqlCommand ();
  36. this.isDirty = true;
  37. }
  38. public SqlDataAdapter (string selectCommandText, SqlConnection selectConnection)
  39. : this (new SqlCommand (selectCommandText, selectConnection))
  40. {
  41. }
  42. public SqlDataAdapter (string selectCommandText, string selectConnectionString)
  43. : this (selectCommandText, new SqlConnection (selectConnectionString))
  44. {
  45. }
  46. #endregion
  47. #region Properties
  48. public new SqlCommand DeleteCommand {
  49. get { return (SqlCommand)deleteCommand; }
  50. set { deleteCommand = value; }
  51. }
  52. public new SqlCommand InsertCommand {
  53. get { return (SqlCommand)insertCommand; }
  54. set { insertCommand = value; }
  55. }
  56. public new SqlCommand SelectCommand {
  57. get { return (SqlCommand)selectCommand; }
  58. set {
  59. this.isDirty = true;
  60. selectCommand = value;
  61. }
  62. }
  63. public new SqlCommand UpdateCommand {
  64. get { return (SqlCommand)updateCommand; }
  65. set { updateCommand = value; }
  66. }
  67. #endregion // Properties
  68. #region Methods
  69. [MonoTODO]
  70. protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
  71. {
  72. throw new NotImplementedException ();
  73. }
  74. [MonoTODO]
  75. protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
  76. {
  77. throw new NotImplementedException ();
  78. }
  79. protected override void OnRowUpdated (RowUpdatedEventArgs value)
  80. {
  81. throw new NotImplementedException ();
  82. }
  83. protected override void OnRowUpdating (RowUpdatingEventArgs value)
  84. {
  85. throw new NotImplementedException ();
  86. }
  87. #endregion // Methods
  88. #region Events and Delegates
  89. public event SqlRowUpdatedEventHandler RowUpdated;
  90. public event SqlRowUpdatingEventHandler RowUpdating;
  91. #endregion // Events and Delegates
  92. }
  93. }