SqlMetaData.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. //
  2. // System.Data.Sql.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.SqlTypes;
  34. namespace System.Data.Sql {
  35. public sealed class SqlMetaData
  36. {
  37. #region Fields
  38. public const long x_lMax = -1;
  39. SqlCompareOptions compareOptions = SqlCompareOptions.None;
  40. string databaseName = null;
  41. bool isPartialLength = false;
  42. long localeId = 0L;
  43. long maxLength = 4L;
  44. string name;
  45. byte precision = 10;
  46. byte scale = 0;
  47. string schemaName = null;
  48. SqlDbType sqlDbType = SqlDbType.Int;
  49. #endregion // Fields
  50. #region Constructors
  51. [MonoTODO]
  52. public SqlMetaData (string name, SqlDbType type)
  53. {
  54. this.name = name;
  55. this.sqlDbType = type;
  56. }
  57. [MonoTODO]
  58. public SqlMetaData (string name, SqlDbType type, long maxLength)
  59. {
  60. this.maxLength = maxLength;
  61. this.name = name;
  62. this.sqlDbType = type;
  63. }
  64. [MonoTODO]
  65. public SqlMetaData (string name, SqlDbType type, SqlMetaData[] columnMetaData)
  66. {
  67. this.sqlDbType = type;
  68. }
  69. [MonoTODO]
  70. public SqlMetaData (string name, SqlDbType type, byte precision, byte scale)
  71. {
  72. this.name = name;
  73. this.precision = precision;
  74. this.scale = scale;
  75. this.sqlDbType = type;
  76. }
  77. [MonoTODO]
  78. public SqlMetaData (string strName, long maxLength, long localeId, SqlCompareOptions compareOptions, string udtTypeName)
  79. {
  80. this.compareOptions = compareOptions;
  81. this.localeId = localeId;
  82. this.maxLength = maxLength;
  83. this.name = strName;
  84. }
  85. [MonoTODO]
  86. public SqlMetaData (string name, SqlDbType type, long maxLength, long locale, SqlCompareOptions compareOptions)
  87. {
  88. this.compareOptions = compareOptions;
  89. this.localeId = locale;
  90. this.maxLength = maxLength;
  91. this.name = name;
  92. this.sqlDbType = type;
  93. }
  94. [MonoTODO]
  95. public SqlMetaData (string name, SqlDbType type, long maxLength, byte precision, byte scale, long localeId, SqlCompareOptions compareOptions, string DatabaseName, string SchemaName, bool PartialLength, string udtTypeName)
  96. {
  97. this.compareOptions = compareOptions;
  98. this.databaseName = DatabaseName;
  99. this.isPartialLength = PartialLength;
  100. this.localeId = localeId;
  101. this.maxLength = maxLength;
  102. this.name = name;
  103. this.precision = precision;
  104. this.scale = scale;
  105. this.schemaName = SchemaName;
  106. this.sqlDbType = type;
  107. }
  108. #endregion // Constructors
  109. #region Properties
  110. public SqlCompareOptions CompareOptions {
  111. get { return compareOptions; }
  112. }
  113. public string DatabaseName {
  114. get { return databaseName; }
  115. }
  116. [MonoTODO]
  117. public DbType DbType {
  118. get { throw new NotImplementedException (); }
  119. }
  120. public bool IsPartialLength {
  121. get { return isPartialLength; }
  122. }
  123. public long LocaleId {
  124. get { return localeId; }
  125. }
  126. public static long MAX {
  127. get { return x_lMax; }
  128. }
  129. public long MaxLength {
  130. get { return maxLength; }
  131. }
  132. public string Name {
  133. get { return name; }
  134. }
  135. public byte Precision {
  136. get { return precision; }
  137. }
  138. public byte Scale {
  139. get { return scale; }
  140. }
  141. public string SchemaName {
  142. get { return schemaName; }
  143. }
  144. public SqlDbType SqlDbType {
  145. get { return sqlDbType; }
  146. }
  147. [MonoTODO]
  148. public string TypeName {
  149. get { throw new NotImplementedException (); }
  150. }
  151. #endregion // Properties
  152. #region Methods
  153. [MonoTODO]
  154. public bool Adjust (bool value)
  155. {
  156. throw new NotImplementedException ();
  157. }
  158. [MonoTODO]
  159. public byte Adjust (byte value)
  160. {
  161. throw new NotImplementedException ();
  162. }
  163. [MonoTODO]
  164. public byte[] Adjust (byte[] value)
  165. {
  166. throw new NotImplementedException ();
  167. }
  168. [MonoTODO]
  169. public char Adjust (char value)
  170. {
  171. throw new NotImplementedException ();
  172. }
  173. [MonoTODO]
  174. public char[] Adjust (char[] value)
  175. {
  176. throw new NotImplementedException ();
  177. }
  178. [MonoTODO]
  179. public DateTime Adjust (DateTime value)
  180. {
  181. throw new NotImplementedException ();
  182. }
  183. [MonoTODO]
  184. public decimal Adjust (decimal value)
  185. {
  186. throw new NotImplementedException ();
  187. }
  188. [MonoTODO]
  189. public double Adjust (double value)
  190. {
  191. throw new NotImplementedException ();
  192. }
  193. [MonoTODO]
  194. public Guid Adjust (Guid value)
  195. {
  196. throw new NotImplementedException ();
  197. }
  198. [MonoTODO]
  199. public short Adjust (short value)
  200. {
  201. throw new NotImplementedException ();
  202. }
  203. [MonoTODO]
  204. public int Adjust (int value)
  205. {
  206. throw new NotImplementedException ();
  207. }
  208. [MonoTODO]
  209. public long Adjust (long value)
  210. {
  211. throw new NotImplementedException ();
  212. }
  213. [MonoTODO]
  214. public object Adjust (object value)
  215. {
  216. throw new NotImplementedException ();
  217. }
  218. [MonoTODO]
  219. public float Adjust (float value)
  220. {
  221. throw new NotImplementedException ();
  222. }
  223. [MonoTODO]
  224. public SqlBinary Adjust (SqlBinary value)
  225. {
  226. throw new NotImplementedException ();
  227. }
  228. [MonoTODO]
  229. public SqlBoolean Adjust (SqlBoolean value)
  230. {
  231. throw new NotImplementedException ();
  232. }
  233. [MonoTODO]
  234. public SqlByte Adjust (SqlByte value)
  235. {
  236. throw new NotImplementedException ();
  237. }
  238. [MonoTODO]
  239. public SqlBytes Adjust (SqlBytes value)
  240. {
  241. throw new NotImplementedException ();
  242. }
  243. [MonoTODO]
  244. public SqlChars Adjust (SqlChars value)
  245. {
  246. throw new NotImplementedException ();
  247. }
  248. [MonoTODO]
  249. public SqlDateTime Adjust (SqlDateTime value)
  250. {
  251. throw new NotImplementedException ();
  252. }
  253. [MonoTODO]
  254. public SqlDecimal Adjust (SqlDecimal value)
  255. {
  256. throw new NotImplementedException ();
  257. }
  258. [MonoTODO]
  259. public SqlDouble Adjust (SqlDouble value)
  260. {
  261. throw new NotImplementedException ();
  262. }
  263. [MonoTODO]
  264. public SqlGuid Adjust (SqlGuid value)
  265. {
  266. throw new NotImplementedException ();
  267. }
  268. [MonoTODO]
  269. public SqlInt16 Adjust (SqlInt16 value)
  270. {
  271. throw new NotImplementedException ();
  272. }
  273. [MonoTODO]
  274. public SqlInt32 Adjust (SqlInt32 value)
  275. {
  276. throw new NotImplementedException ();
  277. }
  278. [MonoTODO]
  279. public SqlInt64 Adjust (SqlInt64 value)
  280. {
  281. throw new NotImplementedException ();
  282. }
  283. [MonoTODO]
  284. public SqlMoney Adjust (SqlMoney value)
  285. {
  286. throw new NotImplementedException ();
  287. }
  288. [MonoTODO]
  289. public SqlSingle Adjust (SqlSingle value)
  290. {
  291. throw new NotImplementedException ();
  292. }
  293. [MonoTODO]
  294. public SqlString Adjust (SqlString value)
  295. {
  296. throw new NotImplementedException ();
  297. }
  298. [MonoTODO]
  299. public string Adjust (string value)
  300. {
  301. throw new NotImplementedException ();
  302. }
  303. [MonoTODO]
  304. public SqlMetaData GetMetaData (int i)
  305. {
  306. throw new NotImplementedException ();
  307. }
  308. [MonoTODO]
  309. public static SqlMetaData InferFromValue (object value, string name)
  310. {
  311. throw new NotImplementedException ();
  312. }
  313. #endregion // Methods
  314. }
  315. }
  316. #endif