2 // Mono.Data.MySql.MySqlParameter.cs
5 // Rodrigo Moya (rodrigo@ximian.com)
6 // Daniel Morgan (danmorg@sc.rr.com)
8 // (C) Ximian, Inc. 2002
11 using System.ComponentModel;
13 using System.Data.Common;
14 using System.Runtime.InteropServices;
16 namespace Mono.Data.MySql
19 /// Represents a parameter to a Command object, and optionally,
20 /// its mapping to DataSet columns; and is implemented by .NET
21 /// data providers that access data sources.
23 //public sealed class MySqlParameter : MarshalByRefObject,
24 // IDbDataParameter, IDataParameter, ICloneable
25 public sealed class MySqlParameter : IDbDataParameter, IDataParameter
27 private string parmName;
28 private DbType dbtype;
29 private object objValue;
31 private string sourceColumn;
32 private ParameterDirection direction;
33 private bool isNullable;
34 private byte precision;
36 private DataRowVersion sourceVersion;
40 public MySqlParameter () {
45 public MySqlParameter (string parameterName, object value) {
46 this.parmName = parameterName;
47 this.objValue = value;
51 public MySqlParameter(string parameterName, DbType dbType) {
52 this.parmName = parameterName;
57 public MySqlParameter(string parameterName, DbType dbType,
60 this.parmName = parameterName;
66 public MySqlParameter(string parameterName, DbType dbType,
67 int size, string sourceColumn) {
69 this.parmName = parameterName;
72 this.sourceColumn = sourceColumn;
76 public MySqlParameter(string parameterName, DbType dbType,
77 int size, ParameterDirection direction,
78 bool isNullable, byte precision,
79 byte scale, string sourceColumn,
80 DataRowVersion sourceVersion, object value) {
82 this.parmName = parameterName;
85 this.sourceColumn = sourceColumn;
86 this.direction = direction;
87 this.isNullable = isNullable;
88 this.precision = precision;
90 this.sourceVersion = sourceVersion;
91 this.objValue = value;
95 public DbType DbType {
105 public ParameterDirection Direction {
115 public bool IsNullable {
133 string IDataParameter.ParameterName {
143 public string ParameterName {
154 public string SourceColumn {
160 sourceColumn = value;
165 public DataRowVersion SourceVersion {
167 return sourceVersion;
171 sourceVersion = value;
176 public object Value {
187 public byte Precision {
221 public override string ToString() {