SqlParameter.platformnotsupported.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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.ComponentModel;
  5. using System.Collections.Generic;
  6. using System.Data.Common;
  7. using System.Data.SqlTypes;
  8. using System.Diagnostics;
  9. using System.IO;
  10. using System.Globalization;
  11. using System.Reflection;
  12. using System.Xml;
  13. using MSS = Microsoft.SqlServer.Server;
  14. using Microsoft.SqlServer.Server;
  15. using System.ComponentModel.Design.Serialization;
  16. namespace System.Data.SqlClient
  17. {
  18. public sealed partial class SqlParameter : DbParameter, IDbDataParameter, ICloneable
  19. {
  20. const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlParameter is not supported on the current platform.";
  21. public SqlParameter() : base() {}
  22. public SqlParameter(string parameterName, SqlDbType dbType) : this() {}
  23. public SqlParameter(string parameterName, object value) : this() {}
  24. public SqlParameter(string parameterName, SqlDbType dbType, int size) : this() {}
  25. public SqlParameter(string parameterName, SqlDbType dbType, int size, string sourceColumn) : this() {}
  26. public SqlParameter(
  27. string parameterName,
  28. SqlDbType dbType,
  29. int size,
  30. ParameterDirection direction,
  31. bool isNullable,
  32. byte precision,
  33. byte scale,
  34. string sourceColumn,
  35. DataRowVersion sourceVersion,
  36. object value
  37. ) : this(parameterName, dbType, size, sourceColumn)
  38. {
  39. }
  40. public SqlParameter(
  41. string parameterName,
  42. SqlDbType dbType,
  43. int size,
  44. ParameterDirection direction,
  45. byte precision,
  46. byte scale,
  47. string sourceColumn,
  48. DataRowVersion sourceVersion,
  49. bool sourceColumnNullMapping,
  50. object value,
  51. string xmlSchemaCollectionDatabase,
  52. string xmlSchemaCollectionOwningSchema,
  53. string xmlSchemaCollectionName
  54. ) : this()
  55. {
  56. }
  57. internal SqlCollation Collation
  58. {
  59. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  60. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  61. }
  62. public string XmlSchemaCollectionDatabase
  63. {
  64. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  65. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  66. }
  67. public string XmlSchemaCollectionOwningSchema
  68. {
  69. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  70. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  71. }
  72. public string XmlSchemaCollectionName
  73. {
  74. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  75. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  76. }
  77. public override DbType DbType
  78. {
  79. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  80. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  81. }
  82. public override void ResetDbType()
  83. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  84. internal MetaType InternalMetaType
  85. {
  86. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  87. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  88. }
  89. public int LocaleId
  90. {
  91. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  92. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  93. }
  94. internal MSS.SmiParameterMetaData MetaDataForSmi(out ParameterPeekAheadValue peekAhead)
  95. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  96. internal bool ParameterIsSqlType
  97. {
  98. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  99. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  100. }
  101. public override string ParameterName
  102. {
  103. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  104. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  105. }
  106. internal string ParameterNameFixed
  107. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  108. public new byte Precision
  109. {
  110. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  111. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  112. }
  113. internal byte PrecisionInternal
  114. {
  115. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  116. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  117. }
  118. public new byte Scale
  119. {
  120. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  121. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  122. }
  123. internal byte ScaleInternal
  124. {
  125. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  126. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  127. }
  128. public SqlDbType SqlDbType
  129. {
  130. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  131. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  132. }
  133. public void ResetSqlDbType()
  134. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  135. public object SqlValue
  136. {
  137. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  138. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  139. }
  140. public string UdtTypeName
  141. {
  142. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  143. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  144. }
  145. public String TypeName
  146. {
  147. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  148. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  149. }
  150. public override object Value
  151. {
  152. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  153. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  154. }
  155. internal INullable ValueAsINullable
  156. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  157. internal bool IsNull
  158. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  159. internal int GetActualSize()
  160. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  161. object ICloneable.Clone()
  162. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  163. internal static object CoerceValue(object value, MetaType destinationType, out bool coercedToDataFeed, out bool typeChanged, bool allowStreaming = true)
  164. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  165. internal void FixStreamDataForNonPLP()
  166. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  167. public override DataRowVersion SourceVersion
  168. {
  169. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  170. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  171. }
  172. internal byte GetActualPrecision()
  173. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  174. internal byte GetActualScale()
  175. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  176. internal int GetParameterSize()
  177. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  178. internal object GetCoercedValue()
  179. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  180. internal bool CoercedValueIsSqlType
  181. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  182. internal bool CoercedValueIsDataFeed
  183. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  184. [Conditional("DEBUG")]
  185. internal void AssertCachedPropertiesAreValid()
  186. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  187. [Conditional("DEBUG")]
  188. internal void AssertPropertiesAreValid(object value, bool? isSqlType = null, bool? isDataFeed = null, bool? isNull = null)
  189. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  190. internal void Prepare(SqlCommand cmd)
  191. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  192. internal void SetSqlBuffer(SqlBuffer buff)
  193. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  194. internal void SetUdtLoadError(Exception e)
  195. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  196. internal void Validate(int index, bool isCommandProc)
  197. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  198. internal MetaType ValidateTypeLengths()
  199. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  200. internal static string[] ParseTypeName(string typeName, bool isUdtTypeName)
  201. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  202. internal sealed class SqlParameterConverter : ExpandableObjectConverter
  203. {
  204. public SqlParameterConverter()
  205. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  206. public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
  207. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  208. public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
  209. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  210. }
  211. public override ParameterDirection Direction
  212. {
  213. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  214. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  215. }
  216. public override bool IsNullable
  217. {
  218. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  219. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  220. }
  221. public int Offset
  222. {
  223. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  224. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  225. }
  226. public override int Size
  227. {
  228. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  229. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  230. }
  231. public override string SourceColumn
  232. {
  233. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  234. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  235. }
  236. public override bool SourceColumnNullMapping
  237. {
  238. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  239. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  240. }
  241. internal void CopyTo(SqlParameter destination)
  242. => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  243. public SqlCompareOptions CompareInfo
  244. {
  245. get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  246. set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  247. }
  248. }
  249. internal abstract class DataFeed {}
  250. internal class StreamDataFeed : DataFeed
  251. {
  252. internal Stream _source;
  253. internal StreamDataFeed(Stream source) {}
  254. }
  255. internal class TextDataFeed : DataFeed
  256. {
  257. internal TextReader _source;
  258. internal TextDataFeed(TextReader source) {}
  259. }
  260. internal class XmlDataFeed : DataFeed
  261. {
  262. internal XmlReader _source;
  263. internal XmlDataFeed(XmlReader source) {}
  264. }
  265. }