SqlDataAdapter.platformnotsupported.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. using System;
  5. using System.Collections;
  6. using System.ComponentModel;
  7. using System.Data.Common;
  8. using System.Diagnostics;
  9. namespace System.Data.SqlClient
  10. {
  11. public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter, ICloneable
  12. {
  13. const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlDataAdapter is not supported on the current platform.";
  14. public SqlDataAdapter() : base() {}
  15. public SqlDataAdapter(SqlCommand selectCommand) : this() {}
  16. public SqlDataAdapter(string selectCommandText, string selectConnectionString) : this() {}
  17. public SqlDataAdapter(string selectCommandText, SqlConnection selectConnection) : this() {}
  18. new public SqlCommand DeleteCommand {
  19. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  20. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  21. }
  22. IDbCommand IDbDataAdapter.DeleteCommand {
  23. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  24. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  25. }
  26. new public SqlCommand InsertCommand {
  27. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  28. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  29. }
  30. IDbCommand IDbDataAdapter.InsertCommand {
  31. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  32. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  33. }
  34. new public SqlCommand SelectCommand {
  35. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  36. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  37. }
  38. IDbCommand IDbDataAdapter.SelectCommand {
  39. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  40. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  41. }
  42. new public SqlCommand UpdateCommand {
  43. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  44. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  45. }
  46. IDbCommand IDbDataAdapter.UpdateCommand {
  47. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  48. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  49. }
  50. public override int UpdateBatchSize {
  51. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  52. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  53. }
  54. protected override int AddToBatch(IDbCommand command)
  55. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  56. protected override void ClearBatch()
  57. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  58. protected override int ExecuteBatch()
  59. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  60. protected override IDataParameter GetBatchedParameter(int commandIdentifier, int parameterIndex)
  61. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  62. protected override bool GetBatchedRecordsAffected(int commandIdentifier, out int recordsAffected, out Exception error)
  63. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  64. protected override void InitializeBatching()
  65. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  66. protected override void TerminateBatching()
  67. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  68. object ICloneable.Clone()
  69. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  70. protected override RowUpdatedEventArgs CreateRowUpdatedEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
  71. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  72. protected override RowUpdatingEventArgs CreateRowUpdatingEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
  73. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  74. public event SqlRowUpdatedEventHandler RowUpdated;
  75. public event SqlRowUpdatingEventHandler RowUpdating;
  76. override protected void OnRowUpdated(RowUpdatedEventArgs value)
  77. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  78. override protected void OnRowUpdating(RowUpdatingEventArgs value)
  79. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  80. }
  81. }