5 // Rolf Bjarne Kvinge <rolf@xamarin.com>
7 // Copyright (c) 2016 Xamarin, Inc.
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to deal
11 // in the Software without restriction, including without limitation the rights
12 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 // copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 using System.Data.Common;
28 using System.Data.Sql;
29 using System.Threading.Tasks;
30 using System.Threading;
33 namespace System.Data.SqlClient {
34 public sealed class SqlCommand : DbCommand, IDbCommand, ICloneable
36 const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlCommand is not supported on the current platform.";
39 : this (String.Empty, null, null)
43 public SqlCommand (string cmdText)
44 : this (cmdText, null, null)
48 public SqlCommand (string cmdText, SqlConnection connection)
49 : this (cmdText, connection, null)
53 public SqlCommand (string cmdText, SqlConnection connection, SqlTransaction transaction)
55 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
58 public override string CommandText {
59 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
60 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
63 public override int CommandTimeout {
64 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
65 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
68 public override CommandType CommandType {
69 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
70 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
73 public new SqlConnection Connection {
74 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
75 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
78 public override bool DesignTimeVisible {
79 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
80 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
83 public new SqlParameterCollection Parameters {
84 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
87 public new SqlTransaction Transaction {
88 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
89 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
92 public override UpdateRowSource UpdatedRowSource {
93 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
94 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
97 public SqlNotificationRequest Notification {
98 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
99 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
102 public bool NotificationAutoEnlist {
103 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
104 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
107 public override void Cancel ()
109 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
112 public SqlCommand Clone ()
114 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
117 public new SqlParameter CreateParameter ()
119 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
122 public override int ExecuteNonQuery ()
124 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
127 public new SqlDataReader ExecuteReader ()
129 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
132 public new SqlDataReader ExecuteReader (CommandBehavior behavior)
134 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
137 public new Task<SqlDataReader> ExecuteReaderAsync ()
139 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
142 public new Task<SqlDataReader> ExecuteReaderAsync (CancellationToken cancellationToken)
144 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
147 public new Task<SqlDataReader> ExecuteReaderAsync (CommandBehavior behavior)
149 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
152 public new Task<SqlDataReader> ExecuteReaderAsync (CommandBehavior behavior, CancellationToken cancellationToken)
154 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
157 public Task<XmlReader> ExecuteXmlReaderAsync ()
159 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
162 public Task<XmlReader> ExecuteXmlReaderAsync (CancellationToken cancellationToken)
164 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
167 public override object ExecuteScalar ()
169 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
172 public XmlReader ExecuteXmlReader ()
174 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
177 object ICloneable.Clone ()
179 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
182 protected override void Dispose (bool disposing)
186 public override void Prepare ()
188 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
191 public void ResetCommandTimeout ()
193 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
196 protected override DbParameter CreateDbParameter ()
198 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
201 protected override DbDataReader ExecuteDbDataReader (CommandBehavior behavior)
203 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
206 protected override DbConnection DbConnection {
207 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
208 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
211 protected override DbParameterCollection DbParameterCollection {
212 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
215 protected override DbTransaction DbTransaction {
216 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
217 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
220 public IAsyncResult BeginExecuteNonQuery ()
222 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
225 public IAsyncResult BeginExecuteNonQuery (AsyncCallback callback, object stateObject)
227 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
230 public int EndExecuteNonQuery (IAsyncResult asyncResult)
232 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
235 public IAsyncResult BeginExecuteReader ()
237 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
240 public IAsyncResult BeginExecuteReader (CommandBehavior behavior)
242 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
245 public IAsyncResult BeginExecuteReader (AsyncCallback callback, object stateObject)
247 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
250 public IAsyncResult BeginExecuteReader (AsyncCallback callback, object stateObject, CommandBehavior behavior)
252 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
255 public SqlDataReader EndExecuteReader (IAsyncResult asyncResult)
257 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
260 public IAsyncResult BeginExecuteXmlReader (AsyncCallback callback, object stateObject)
262 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
265 public IAsyncResult BeginExecuteXmlReader ()
267 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
270 public XmlReader EndExecuteXmlReader (IAsyncResult asyncResult)
272 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
275 public event StatementCompletedEventHandler StatementCompleted;