Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | When creating a parameter associated with a specific command, keep track of that command. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
64d7e6903e016e4226668038cdac1f1c |
User & Date: | mistachkin 2015-03-26 20:38:30 |
Context
2015-03-26
| ||
21:55 | When BinaryGUID handling is off, transform the LINQ paramter types as well. Fix for [a4d9c7ee94]. check-in: 87b4244129 user: mistachkin tags: trunk | |
20:38 | When creating a parameter associated with a specific command, keep track of that command. check-in: 64d7e6903e user: mistachkin tags: trunk | |
20:20 | Make the DbType value of (-1) a constant in the parameter class. check-in: 30d638f582 user: mistachkin tags: trunk | |
Changes
Changes to System.Data.SQLite/SQLiteCommand.cs.
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
...
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
|
/// <summary> /// Create a new parameter /// </summary> /// <returns></returns> public new SQLiteParameter CreateParameter() { CheckDisposed(); return new SQLiteParameter(); } /// <summary> /// The connection associated with this command /// </summary> #if !PLATFORM_COMPACTFRAMEWORK [DefaultValue((string)null), Editor("Microsoft.VSDesigner.Data.Design.DbConnectionEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] ................................................................................ { command.CommandText = commandText; if (args != null) { foreach (object arg in args) { if (arg is SQLiteParameter) command.Parameters.Add((SQLiteParameter)arg); else command.Parameters.Add(new SQLiteParameter(DbType.Object, arg)); } } switch (executeType) { case SQLiteExecuteType.None: { |
|
|
>
>
>
>
>
>
>
>
|
<
<
|
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
...
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
|
/// <summary> /// Create a new parameter /// </summary> /// <returns></returns> public new SQLiteParameter CreateParameter() { CheckDisposed(); return new SQLiteParameter(this); } /// <summary> /// The connection associated with this command /// </summary> #if !PLATFORM_COMPACTFRAMEWORK [DefaultValue((string)null), Editor("Microsoft.VSDesigner.Data.Design.DbConnectionEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] ................................................................................ { command.CommandText = commandText; if (args != null) { foreach (object arg in args) { SQLiteParameter parameter = arg as SQLiteParameter; if (parameter == null) { parameter = command.CreateParameter(); parameter.DbType = DbType.Object; parameter.Value = arg; } command.Parameters.Add(parameter); } } switch (executeType) { case SQLiteExecuteType.None: { |
Changes to System.Data.SQLite/SQLiteParameter.cs.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 .. 45 46 47 48 49 50 51 52 53 54 55 56 57 58 ... 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 ... 275 276 277 278 279 280 281 282 283 284 285 286 287 288 ... 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
public sealed class SQLiteParameter : DbParameter, ICloneable { /// <summary> /// This value represents an "unknown" <see cref="DbType" />. /// </summary> private const DbType UnknownDbType = (DbType)(-1); /// <summary> /// The data type of the parameter /// </summary> internal DbType _dbType; /// <summary> /// The version information for mapping the parameter /// </summary> ................................................................................ /// <summary> /// The data size, unused by SQLite /// </summary> private int _dataSize; private bool _nullable; private bool _nullMapping; /// <summary> /// Default constructor /// </summary> public SQLiteParameter() : this(null, UnknownDbType, 0, null, DataRowVersion.Current) { ................................................................................ _sourceColumn = sourceColumn; _rowVersion = rowVersion; _dataSize = parameterSize; _nullable = true; } private SQLiteParameter(SQLiteParameter source) : this(source.ParameterName, (DbType)source._dbType, 0, source.Direction, source.IsNullable, 0, 0, source.SourceColumn, source.SourceVersion, source.Value) { _nullMapping = source._nullMapping; } /// <summary> /// Constructs a named parameter of the specified type, size, source column and row version /// </summary> ................................................................................ /// <param name="parameterSize">The size of the parameter</param> /// <param name="sourceColumn">The source column</param> /// <param name="rowVersion">The row version information</param> public SQLiteParameter(DbType parameterType, int parameterSize, string sourceColumn, DataRowVersion rowVersion) : this(null, parameterType, parameterSize, sourceColumn, rowVersion) { } /// <summary> /// Whether or not the parameter can contain a null value /// </summary> public override bool IsNullable { get ................................................................................ { if (_objValue != null && _objValue != DBNull.Value) { return SQLiteConvert.TypeToDbType(_objValue.GetType()); } return DbType.String; // Unassigned default value is String } return (DbType)_dbType; } set { _dbType = value; } } |
> > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > | |
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 .. 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 ... 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 ... 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 ... 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
public sealed class SQLiteParameter : DbParameter, ICloneable { /// <summary> /// This value represents an "unknown" <see cref="DbType" />. /// </summary> private const DbType UnknownDbType = (DbType)(-1); /// <summary> /// The command associated with this parameter. /// </summary> private IDbCommand _command; /// <summary> /// The data type of the parameter /// </summary> internal DbType _dbType; /// <summary> /// The version information for mapping the parameter /// </summary> ................................................................................ /// <summary> /// The data size, unused by SQLite /// </summary> private int _dataSize; private bool _nullable; private bool _nullMapping; /// <summary> /// Constructor used when creating for use with a specific command. /// </summary> /// <param name="command"> /// The command associated with this parameter. /// </param> internal SQLiteParameter( IDbCommand command ) : this() { _command = command; } /// <summary> /// Default constructor /// </summary> public SQLiteParameter() : this(null, UnknownDbType, 0, null, DataRowVersion.Current) { ................................................................................ _sourceColumn = sourceColumn; _rowVersion = rowVersion; _dataSize = parameterSize; _nullable = true; } private SQLiteParameter(SQLiteParameter source) : this(source.ParameterName, source._dbType, 0, source.Direction, source.IsNullable, 0, 0, source.SourceColumn, source.SourceVersion, source.Value) { _nullMapping = source._nullMapping; } /// <summary> /// Constructs a named parameter of the specified type, size, source column and row version /// </summary> ................................................................................ /// <param name="parameterSize">The size of the parameter</param> /// <param name="sourceColumn">The source column</param> /// <param name="rowVersion">The row version information</param> public SQLiteParameter(DbType parameterType, int parameterSize, string sourceColumn, DataRowVersion rowVersion) : this(null, parameterType, parameterSize, sourceColumn, rowVersion) { } /// <summary> /// The command associated with this parameter. /// </summary> public IDbCommand Command { get { return _command; } set { _command = value; } } /// <summary> /// Whether or not the parameter can contain a null value /// </summary> public override bool IsNullable { get ................................................................................ { if (_objValue != null && _objValue != DBNull.Value) { return SQLiteConvert.TypeToDbType(_objValue.GetType()); } return DbType.String; // Unassigned default value is String } return _dbType; } set { _dbType = value; } } |