SqlMetaData.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. //
  2. // Microsoft.SqlServer.Server.SqlMetaData
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2003
  8. //
  9. //
  10. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  11. //
  12. // Permission is hereby granted, free of charge, to any person obtaining
  13. // a copy of this software and associated documentation files (the
  14. // "Software"), to deal in the Software without restriction, including
  15. // without limitation the rights to use, copy, modify, merge, publish,
  16. // distribute, sublicense, and/or sell copies of the Software, and to
  17. // permit persons to whom the Software is furnished to do so, subject to
  18. // the following conditions:
  19. //
  20. // The above copyright notice and this permission notice shall be
  21. // included in all copies or substantial portions of the Software.
  22. //
  23. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  27. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  28. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  29. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  30. //
  31. #if NET_2_0
  32. using System;
  33. using System.Data;
  34. using System.Data.SqlTypes;
  35. namespace Microsoft.SqlServer.Server {
  36. public sealed class SqlMetaData
  37. {
  38. #region Fields
  39. public const long x_lMax = -1;
  40. SqlCompareOptions compareOptions = SqlCompareOptions.None;
  41. string databaseName = null;
  42. bool isPartialLength = false;
  43. long localeId = 0L;
  44. long maxLength = 4L;
  45. string name;
  46. byte precision = 10;
  47. byte scale = 0;
  48. string schemaName = null;
  49. SqlDbType sqlDbType = SqlDbType.Int;
  50. #endregion // Fields
  51. #region Constructors
  52. [MonoTODO]
  53. public SqlMetaData (string name, SqlDbType type)
  54. {
  55. this.name = name;
  56. this.sqlDbType = type;
  57. }
  58. [MonoTODO]
  59. public SqlMetaData (string name, SqlDbType type, long maxLength)
  60. {
  61. this.maxLength = maxLength;
  62. this.name = name;
  63. this.sqlDbType = type;
  64. }
  65. [MonoTODO]
  66. public SqlMetaData (string name, SqlDbType type, SqlMetaData[] columnMetaData)
  67. {
  68. this.sqlDbType = type;
  69. }
  70. [MonoTODO]
  71. public SqlMetaData (string name, SqlDbType type, byte precision, byte scale)
  72. {
  73. this.name = name;
  74. this.precision = precision;
  75. this.scale = scale;
  76. this.sqlDbType = type;
  77. }
  78. [MonoTODO]
  79. public SqlMetaData (string strName, long maxLength, long localeId, SqlCompareOptions compareOptions, string udtTypeName)
  80. {
  81. this.compareOptions = compareOptions;
  82. this.localeId = localeId;
  83. this.maxLength = maxLength;
  84. this.name = strName;
  85. }
  86. [MonoTODO]
  87. public SqlMetaData (string name, SqlDbType type, long maxLength, long locale, SqlCompareOptions compareOptions)
  88. {
  89. this.compareOptions = compareOptions;
  90. this.localeId = locale;
  91. this.maxLength = maxLength;
  92. this.name = name;
  93. this.sqlDbType = type;
  94. }
  95. [MonoTODO]
  96. public SqlMetaData (string name, SqlDbType type, long maxLength, byte precision, byte scale, long localeId, SqlCompareOptions compareOptions, string DatabaseName, string SchemaName, bool PartialLength, string udtTypeName)
  97. {
  98. this.compareOptions = compareOptions;
  99. this.databaseName = DatabaseName;
  100. this.isPartialLength = PartialLength;
  101. this.localeId = localeId;
  102. this.maxLength = maxLength;
  103. this.name = name;
  104. this.precision = precision;
  105. this.scale = scale;
  106. this.schemaName = SchemaName;
  107. this.sqlDbType = type;
  108. }
  109. #endregion // Constructors
  110. #region Properties
  111. public SqlCompareOptions CompareOptions {
  112. get { return compareOptions; }
  113. }
  114. public string DatabaseName {
  115. get { return databaseName; }
  116. }
  117. [MonoTODO]
  118. public DbType DbType {
  119. get { throw new NotImplementedException (); }
  120. }
  121. public bool IsPartialLength {
  122. get { return isPartialLength; }
  123. }
  124. public long LocaleId {
  125. get { return localeId; }
  126. }
  127. public static long MAX {
  128. get { return x_lMax; }
  129. }
  130. public long MaxLength {
  131. get { return maxLength; }
  132. }
  133. public string Name {
  134. get { return name; }
  135. }
  136. public byte Precision {
  137. get { return precision; }
  138. }
  139. public byte Scale {
  140. get { return scale; }
  141. }
  142. public string SchemaName {
  143. get { return schemaName; }
  144. }
  145. public SqlDbType SqlDbType {
  146. get { return sqlDbType; }
  147. }
  148. [MonoTODO]
  149. public string TypeName {
  150. get { throw new NotImplementedException (); }
  151. }
  152. #endregion // Properties
  153. #region Methods
  154. [MonoTODO]
  155. public bool Adjust (bool value)
  156. {
  157. throw new NotImplementedException ();
  158. }
  159. [MonoTODO]
  160. public byte Adjust (byte value)
  161. {
  162. throw new NotImplementedException ();
  163. }
  164. [MonoTODO]
  165. public byte[] Adjust (byte[] value)
  166. {
  167. throw new NotImplementedException ();
  168. }
  169. [MonoTODO]
  170. public char Adjust (char value)
  171. {
  172. throw new NotImplementedException ();
  173. }
  174. [MonoTODO]
  175. public char[] Adjust (char[] value)
  176. {
  177. throw new NotImplementedException ();
  178. }
  179. [MonoTODO]
  180. public DateTime Adjust (DateTime value)
  181. {
  182. throw new NotImplementedException ();
  183. }
  184. [MonoTODO]
  185. public decimal Adjust (decimal value)
  186. {
  187. throw new NotImplementedException ();
  188. }
  189. [MonoTODO]
  190. public double Adjust (double value)
  191. {
  192. throw new NotImplementedException ();
  193. }
  194. [MonoTODO]
  195. public Guid Adjust (Guid value)
  196. {
  197. throw new NotImplementedException ();
  198. }
  199. [MonoTODO]
  200. public short Adjust (short value)
  201. {
  202. throw new NotImplementedException ();
  203. }
  204. [MonoTODO]
  205. public int Adjust (int value)
  206. {
  207. throw new NotImplementedException ();
  208. }
  209. [MonoTODO]
  210. public long Adjust (long value)
  211. {
  212. throw new NotImplementedException ();
  213. }
  214. [MonoTODO]
  215. public object Adjust (object value)
  216. {
  217. throw new NotImplementedException ();
  218. }
  219. [MonoTODO]
  220. public float Adjust (float value)
  221. {
  222. throw new NotImplementedException ();
  223. }
  224. [MonoTODO]
  225. public SqlBinary Adjust (SqlBinary value)
  226. {
  227. throw new NotImplementedException ();
  228. }
  229. [MonoTODO]
  230. public SqlBoolean Adjust (SqlBoolean value)
  231. {
  232. throw new NotImplementedException ();
  233. }
  234. [MonoTODO]
  235. public SqlByte Adjust (SqlByte value)
  236. {
  237. throw new NotImplementedException ();
  238. }
  239. [MonoTODO]
  240. public SqlBytes Adjust (SqlBytes value)
  241. {
  242. throw new NotImplementedException ();
  243. }
  244. [MonoTODO]
  245. public SqlChars Adjust (SqlChars value)
  246. {
  247. throw new NotImplementedException ();
  248. }
  249. [MonoTODO]
  250. public SqlDateTime Adjust (SqlDateTime value)
  251. {
  252. throw new NotImplementedException ();
  253. }
  254. [MonoTODO]
  255. public SqlDecimal Adjust (SqlDecimal value)
  256. {
  257. throw new NotImplementedException ();
  258. }
  259. [MonoTODO]
  260. public SqlDouble Adjust (SqlDouble value)
  261. {
  262. throw new NotImplementedException ();
  263. }
  264. [MonoTODO]
  265. public SqlGuid Adjust (SqlGuid value)
  266. {
  267. throw new NotImplementedException ();
  268. }
  269. [MonoTODO]
  270. public SqlInt16 Adjust (SqlInt16 value)
  271. {
  272. throw new NotImplementedException ();
  273. }
  274. [MonoTODO]
  275. public SqlInt32 Adjust (SqlInt32 value)
  276. {
  277. throw new NotImplementedException ();
  278. }
  279. [MonoTODO]
  280. public SqlInt64 Adjust (SqlInt64 value)
  281. {
  282. throw new NotImplementedException ();
  283. }
  284. [MonoTODO]
  285. public SqlMoney Adjust (SqlMoney value)
  286. {
  287. throw new NotImplementedException ();
  288. }
  289. [MonoTODO]
  290. public SqlSingle Adjust (SqlSingle value)
  291. {
  292. throw new NotImplementedException ();
  293. }
  294. [MonoTODO]
  295. public SqlString Adjust (SqlString value)
  296. {
  297. throw new NotImplementedException ();
  298. }
  299. [MonoTODO]
  300. public string Adjust (string value)
  301. {
  302. throw new NotImplementedException ();
  303. }
  304. [MonoTODO]
  305. public SqlMetaData GetMetaData (int i)
  306. {
  307. throw new NotImplementedException ();
  308. }
  309. [MonoTODO]
  310. public static SqlMetaData InferFromValue (object value, string name)
  311. {
  312. throw new NotImplementedException ();
  313. }
  314. #endregion // Methods
  315. }
  316. }
  317. #endif