SqlCommand.platformnotsupported.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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.Collections.Generic;
  5. using System.Data.Common;
  6. using System.Data.Sql;
  7. using System.Data.SqlTypes;
  8. using System.Diagnostics;
  9. using System.IO;
  10. using System.Runtime.CompilerServices;
  11. using System.Text;
  12. using System.Threading;
  13. using System.Threading.Tasks;
  14. using System.Xml;
  15. using Microsoft.SqlServer.Server;
  16. namespace System.Data.SqlClient
  17. {
  18. public sealed partial class SqlCommand : DbCommand, ICloneable
  19. {
  20. const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlCommand is not supported on the current platform.";
  21. internal SqlDependency _sqlDep;
  22. internal int _rowsAffected = -1;
  23. internal bool InPrepare
  24. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  25. public SqlCommand() : base() => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  26. public SqlCommand(string cmdText) : this() {}
  27. public SqlCommand(string cmdText, SqlConnection connection) : this() {}
  28. public SqlCommand(string cmdText, SqlConnection connection, SqlTransaction transaction) : this() {}
  29. new public SqlConnection Connection {
  30. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  31. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  32. }
  33. override protected DbConnection DbConnection {
  34. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  35. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  36. }
  37. public SqlNotificationRequest Notification {
  38. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  39. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  40. }
  41. internal SqlStatistics Statistics
  42. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  43. new public SqlTransaction Transaction {
  44. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  45. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  46. }
  47. override protected DbTransaction DbTransaction {
  48. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  49. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  50. }
  51. override public string CommandText {
  52. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  53. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  54. }
  55. override public int CommandTimeout {
  56. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  57. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  58. }
  59. public void ResetCommandTimeout()
  60. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  61. override public CommandType CommandType {
  62. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  63. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  64. }
  65. #if DEBUG
  66. internal static int DebugForceAsyncWriteDelay {
  67. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  68. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  69. }
  70. #endif
  71. public override bool DesignTimeVisible {
  72. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  73. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  74. }
  75. new public SqlParameterCollection Parameters
  76. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  77. override protected DbParameterCollection DbParameterCollection
  78. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  79. override public UpdateRowSource UpdatedRowSource {
  80. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  81. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  82. }
  83. public event StatementCompletedEventHandler StatementCompleted;
  84. internal void OnStatementCompleted(int recordCount)
  85. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  86. override public void Prepare()
  87. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  88. internal void Unprepare()
  89. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  90. override public void Cancel()
  91. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  92. new public SqlParameter CreateParameter()
  93. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  94. override protected DbParameter CreateDbParameter()
  95. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  96. override protected void Dispose(bool disposing) {}
  97. override public object ExecuteScalar()
  98. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  99. override public int ExecuteNonQuery()
  100. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  101. public XmlReader ExecuteXmlReader()
  102. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  103. override protected DbDataReader ExecuteDbDataReader(CommandBehavior behavior)
  104. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  105. new public SqlDataReader ExecuteReader()
  106. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  107. new public SqlDataReader ExecuteReader(CommandBehavior behavior)
  108. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  109. internal SqlDataReader EndExecuteReader(IAsyncResult asyncResult)
  110. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  111. internal IAsyncResult BeginExecuteReader(CommandBehavior behavior, AsyncCallback callback, object stateObject)
  112. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  113. public override Task<int> ExecuteNonQueryAsync(CancellationToken cancellationToken)
  114. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  115. protected override Task<DbDataReader> ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
  116. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  117. new public Task<SqlDataReader> ExecuteReaderAsync()
  118. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  119. new public Task<SqlDataReader> ExecuteReaderAsync(CommandBehavior behavior)
  120. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  121. new public Task<SqlDataReader> ExecuteReaderAsync(CancellationToken cancellationToken)
  122. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  123. new public Task<SqlDataReader> ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
  124. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  125. public override Task<object> ExecuteScalarAsync(CancellationToken cancellationToken)
  126. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  127. public Task<XmlReader> ExecuteXmlReaderAsync()
  128. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  129. public Task<XmlReader> ExecuteXmlReaderAsync(CancellationToken cancellationToken)
  130. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  131. internal static readonly string[] PreKatmaiProcParamsNames = new string[] {};
  132. internal static readonly string[] KatmaiProcParamsNames = new string[] {};
  133. internal void DeriveParameters()
  134. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  135. internal _SqlMetaDataSet MetaData
  136. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  137. internal SqlDataReader RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, bool returnStream, [CallerMemberName] string method = "")
  138. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  139. internal SqlDataReader RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, bool returnStream, TaskCompletionSource<object> completion, int timeout, out Task task, bool asyncWrite = false, [CallerMemberName] string method = "")
  140. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  141. internal void OnDoneProc()
  142. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  143. internal void OnReturnStatus(int status)
  144. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  145. internal void OnReturnValue(SqlReturnValue rec, TdsParserStateObject stateObj)
  146. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  147. internal string BuildParamList(TdsParser parser, SqlParameterCollection parameters)
  148. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  149. internal void CheckThrowSNIException()
  150. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  151. internal void OnConnectionClosed()
  152. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  153. internal TdsParserStateObject StateObject
  154. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  155. internal bool IsDirty {
  156. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  157. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  158. }
  159. internal int InternalRecordsAffected {
  160. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  161. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  162. }
  163. internal void ClearBatchCommand()
  164. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  165. internal bool BatchRPCMode {
  166. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  167. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  168. }
  169. internal void AddBatchCommand(string commandText, SqlParameterCollection parameters, CommandType cmdType)
  170. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  171. internal int ExecuteBatchRPCCommand()
  172. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  173. internal int? GetRecordsAffected(int commandIndex)
  174. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  175. internal SqlException GetErrors(int commandIndex)
  176. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  177. #if DEBUG
  178. internal void CompletePendingReadWithSuccess(bool resetForcePendingReadsToWait)
  179. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  180. internal void CompletePendingReadWithFailure(int errorCode, bool resetForcePendingReadsToWait)
  181. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  182. #endif
  183. internal void CancelIgnoreFailure()
  184. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  185. object ICloneable.Clone()
  186. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  187. public SqlCommand Clone()
  188. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  189. public bool NotificationAutoEnlist {
  190. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  191. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  192. }
  193. public IAsyncResult BeginExecuteNonQuery()
  194. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  195. public IAsyncResult BeginExecuteXmlReader()
  196. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  197. public IAsyncResult BeginExecuteReader()
  198. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  199. public IAsyncResult BeginExecuteReader(AsyncCallback callback, object stateObject)
  200. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  201. public IAsyncResult BeginExecuteReader(AsyncCallback callback, object stateObject, CommandBehavior behavior)
  202. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  203. public IAsyncResult BeginExecuteReader(CommandBehavior behavior)
  204. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  205. }
  206. }