[System*] Throw a PlatformNotSupported exception when using the managed networking...
[mono.git] / mcs / class / System.Data / System.Data.SqlClient / SqlParameter.platformnotsupported.cs
1 //
2 // SqlParameter.cs
3 //
4 // Author:
5 //       Rolf Bjarne Kvinge <rolf@xamarin.com>
6 //
7 // Copyright (c) 2016 Xamarin, Inc.
8 //
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:
15 //
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
18 //
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
25 // THE SOFTWARE.
26
27 using System;
28 using System.Data;
29 using System.Data.Common;
30 using System.Data.SqlTypes;
31
32 namespace System.Data.SqlClient
33 {
34         public class SqlParameter : DbParameter , IDbDataParameter, IDataParameter, ICloneable
35         {
36                 const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlParameter is not supported on the current platform.";
37
38                 public SqlParameter ()
39                         : this (String.Empty, SqlDbType.NVarChar, 0, ParameterDirection.Input, false, 0, 0, String.Empty, DataRowVersion.Current, null)
40                 {
41                 }
42
43                 public SqlParameter (string parameterName, object value)
44                 {
45                         throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
46                 }
47
48                 public SqlParameter (string parameterName, SqlDbType dbType) 
49                         : this (parameterName, dbType, 0, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, null)
50                 {
51                 }
52
53                 public SqlParameter (string parameterName, SqlDbType dbType, int size) 
54                         : this (parameterName, dbType, size, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, null)
55                 {
56                 }
57
58                 public SqlParameter (string parameterName, SqlDbType dbType, int size, string sourceColumn) 
59                         : this (parameterName, dbType, size, ParameterDirection.Input, false, 0, 0, sourceColumn, DataRowVersion.Current, null)
60                 {
61                 }
62
63                 public SqlParameter (string parameterName, SqlDbType dbType, int size, ParameterDirection direction, bool isNullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value) 
64                 {
65                         throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
66                 }
67
68                 public SqlParameter (string parameterName, SqlDbType dbType, int size, ParameterDirection direction, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, bool sourceColumnNullMapping, Object value, string xmlSchemaCollectionDatabase, string xmlSchemaCollectionOwningSchema, string xmlSchemaCollectionName)
69                         : this (parameterName, dbType, size, direction, false, precision, scale, sourceColumn, sourceVersion, value)
70                 {
71                 }
72
73                 public override string ToString ()
74                 {
75                         throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
76                 }
77
78                 public override void ResetDbType ()
79                 {
80                         throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
81                 }
82
83                 public void ResetSqlDbType ()
84                 {
85                         throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
86                 }
87
88                 public override DbType DbType {
89                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
90                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
91                 }
92
93                 public override ParameterDirection Direction {
94                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
95                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
96                 }
97
98                 public override bool IsNullable {
99                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
100                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
101                 }
102
103                 public int Offset {
104                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
105                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
106                 }
107
108                 public override string ParameterName {
109                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
110                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
111                 }
112
113                 public byte Precision {
114                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
115                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
116                 }
117
118                 public byte Scale {
119                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
120                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
121                 }
122
123                 public override int Size {
124                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
125                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
126                 }
127
128                 public override string SourceColumn {
129                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
130                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
131                 }
132
133                 public override DataRowVersion SourceVersion {
134                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
135                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
136                 }
137
138                 public SqlDbType SqlDbType {
139                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
140                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
141                 }
142
143                 public override object Value {
144                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
145                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
146                 }
147
148                 public SqlCompareOptions CompareInfo {
149                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
150                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
151                 }
152
153                 public int LocaleId {
154                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
155                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
156                 }
157
158                 public object SqlValue {
159                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
160                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
161                 }
162
163                 public override bool SourceColumnNullMapping {
164                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
165                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
166                 }
167
168                 public string XmlSchemaCollectionDatabase {
169                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
170                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
171                 }
172
173                 public string XmlSchemaCollectionName {
174                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
175                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
176                 }
177
178                 public string XmlSchemaCollectionOwningSchema {
179                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
180                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
181                 }
182
183                 public string UdtTypeName {
184                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
185                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
186                 }
187
188                 public string TypeName {
189                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
190                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
191                 }
192
193                 object ICloneable.Clone ()
194                 {
195                         throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
196                 }
197         }
198 }