2 // Mono.Data.Sqlite.SqliteParameter.cs
4 // Represents a parameter to a SqliteCommand, and optionally, its mapping to
7 // Author(s): Vladimir Vukicevic <vladimir@pobox.com>
8 // Everaldo Canuto <everaldo_canuto@yahoo.com.br>
10 // Copyright (C) 2002 Vladimir Vukicevic
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:
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
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.
35 namespace Mono.Data.Sqlite
37 public class SqliteParameter : IDbDataParameter
44 private DbType originalType;
46 private string source_column;
47 private ParameterDirection direction;
48 private DataRowVersion row_version;
49 private object param_value;
50 private byte precision;
53 private bool isNullable;
54 private bool sourceColumnNullMapping;
58 #region Constructors and destructors
60 public SqliteParameter ()
63 direction = ParameterDirection.Input;
67 public SqliteParameter (string name, DbType type)
74 public SqliteParameter (string name, object value)
79 direction = ParameterDirection.Input;
83 public SqliteParameter (string name, DbType type, int size) : this (name, type)
88 public SqliteParameter (string name, DbType type, int size, string src_column) : this (name ,type, size)
90 source_column = src_column;
97 public DbType DbType {
110 public ParameterDirection Direction {
111 get { return direction; }
112 set { direction = value; }
115 public bool IsNullable {
116 get { return isNullable; }
119 public string ParameterName {
121 set { name = value; }
124 public byte Precision {
125 get { return precision; }
126 set { precision = value; }
130 get { return scale; }
131 set { scale = value; }
136 set { size = value; }
139 public string SourceColumn {
140 get { return source_column; }
141 set { source_column = value; }
144 public DataRowVersion SourceVersion {
145 get { return row_version; }
146 set { row_version = value; }
149 public object Value {
150 get { return param_value; }
151 set { param_value = value; }