SqlParameter.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. //
  2. // System.Data.SqlClient.SqlParameter.cs
  3. //
  4. // Author:
  5. // Rodrigo Moya ([email protected])
  6. // Daniel Morgan ([email protected])
  7. //
  8. // (C) Ximian, Inc. 2002
  9. //
  10. using System;
  11. using System.ComponentModel;
  12. using System.Data;
  13. using System.Data.Common;
  14. using System.Runtime.InteropServices;
  15. namespace System.Data.SqlClient
  16. {
  17. /// <summary>
  18. /// Represents a parameter to a Command object, and optionally,
  19. /// its mapping to DataSet columns; and is implemented by .NET
  20. /// data providers that access data sources.
  21. /// </summary>
  22. //public sealed class SqlParameter : MarshalByRefObject,
  23. // IDbDataParameter, IDataParameter, ICloneable
  24. public sealed class SqlParameter : IDbDataParameter, IDataParameter
  25. {
  26. private string parmName;
  27. private SqlDbType dbtype;
  28. private DbType theDbType;
  29. private object objValue;
  30. private int size;
  31. private string sourceColumn;
  32. private ParameterDirection direction;
  33. private bool isNullable;
  34. private byte precision;
  35. private byte scale;
  36. private DataRowVersion sourceVersion;
  37. private int offset;
  38. [MonoTODO]
  39. public SqlParameter () {
  40. }
  41. [MonoTODO]
  42. public SqlParameter (string parameterName, object value) {
  43. this.parmName = parameterName;
  44. this.objValue = value;
  45. }
  46. [MonoTODO]
  47. public SqlParameter(string parameterName, SqlDbType dbType) {
  48. this.parmName = parameterName;
  49. this.dbtype = dbType;
  50. }
  51. [MonoTODO]
  52. public SqlParameter(string parameterName, SqlDbType dbType,
  53. int size) {
  54. this.parmName = parameterName;
  55. this.dbtype = dbType;
  56. this.size = size;
  57. }
  58. [MonoTODO]
  59. public SqlParameter(string parameterName, SqlDbType dbType,
  60. int size, string sourceColumn) {
  61. this.parmName = parameterName;
  62. this.dbtype = dbType;
  63. this.size = size;
  64. this.sourceColumn = sourceColumn;
  65. }
  66. [MonoTODO]
  67. public SqlParameter(string parameterName, SqlDbType dbType,
  68. int size, ParameterDirection direction,
  69. bool isNullable, byte precision,
  70. byte scale, string sourceColumn,
  71. DataRowVersion sourceVersion, object value) {
  72. this.parmName = parameterName;
  73. this.dbtype = dbType;
  74. this.size = size;
  75. this.sourceColumn = sourceColumn;
  76. this.direction = direction;
  77. this.isNullable = isNullable;
  78. this.precision = precision;
  79. this.scale = scale;
  80. this.sourceVersion = sourceVersion;
  81. this.objValue = value;
  82. }
  83. [MonoTODO]
  84. public DbType DbType {
  85. get {
  86. return theDbType;
  87. }
  88. set {
  89. theDbType = value;
  90. }
  91. }
  92. [MonoTODO]
  93. public ParameterDirection Direction {
  94. get {
  95. return direction;
  96. }
  97. set {
  98. direction = value;
  99. }
  100. }
  101. [MonoTODO]
  102. public bool IsNullable {
  103. get {
  104. return isNullable;
  105. }
  106. }
  107. [MonoTODO]
  108. public int Offset {
  109. get {
  110. return offset;
  111. }
  112. set {
  113. offset = value;
  114. }
  115. }
  116. [MonoTODO]
  117. public string ParameterName {
  118. get {
  119. return parmName;
  120. }
  121. set {
  122. parmName = value;
  123. }
  124. }
  125. [MonoTODO]
  126. public string SourceColumn {
  127. get {
  128. return sourceColumn;
  129. }
  130. set {
  131. sourceColumn = value;
  132. }
  133. }
  134. [MonoTODO]
  135. public DataRowVersion SourceVersion {
  136. get {
  137. return sourceVersion;
  138. }
  139. set {
  140. sourceVersion = value;
  141. }
  142. }
  143. [MonoTODO]
  144. public SqlDbType SqlDbType {
  145. get {
  146. return dbtype;
  147. }
  148. set {
  149. dbtype = value;
  150. }
  151. }
  152. [MonoTODO]
  153. public object Value {
  154. get {
  155. return objValue;
  156. }
  157. set {
  158. objValue = value;
  159. }
  160. }
  161. [MonoTODO]
  162. public byte Precision {
  163. get {
  164. return precision;
  165. }
  166. set {
  167. precision = value;
  168. }
  169. }
  170. [MonoTODO]
  171. public byte Scale {
  172. get {
  173. return scale;
  174. }
  175. set {
  176. scale = value;
  177. }
  178. }
  179. [MonoTODO]
  180. public int Size
  181. {
  182. get {
  183. return size;
  184. }
  185. set {
  186. size = value;
  187. }
  188. }
  189. [MonoTODO]
  190. public override string ToString() {
  191. return parmName;
  192. }
  193. }
  194. }