0000: ef bb bf 2f 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a .../************
0010: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0020: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0030: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 0a 20 2a 20 ************. *
0040: 41 44 4f 2e 4e 45 54 20 32 2e 30 20 44 61 74 61 ADO.NET 2.0 Data
0050: 20 50 72 6f 76 69 64 65 72 20 66 6f 72 20 53 51 Provider for SQ
0060: 4c 69 74 65 20 56 65 72 73 69 6f 6e 20 33 2e 58 Lite Version 3.X
0070: 0a 20 2a 20 57 72 69 74 74 65 6e 20 62 79 20 52 . * Written by R
0080: 6f 62 65 72 74 20 53 69 6d 70 73 6f 6e 20 28 72 obert Simpson (r
0090: 6f 62 65 72 74 40 62 6c 61 63 6b 63 61 73 74 6c obert@blackcastl
00a0: 65 73 6f 66 74 2e 63 6f 6d 29 0a 20 2a 20 0a 20 esoft.com). * .
00b0: 2a 20 52 65 6c 65 61 73 65 64 20 74 6f 20 74 68 * Released to th
00c0: 65 20 70 75 62 6c 69 63 20 64 6f 6d 61 69 6e 2c e public domain,
00d0: 20 75 73 65 20 61 74 20 79 6f 75 72 20 6f 77 6e use at your own
00e0: 20 72 69 73 6b 21 0a 20 2a 2a 2a 2a 2a 2a 2a 2a risk!. ********
00f0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0100: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0110: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0120: 2f 0a 0a 6e 61 6d 65 73 70 61 63 65 20 53 79 73 /..namespace Sys
0130: 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 0a tem.Data.SQLite.
0140: 7b 0a 20 20 75 73 69 6e 67 20 53 79 73 74 65 6d {. using System
0150: 3b 0a 20 20 75 73 69 6e 67 20 53 79 73 74 65 6d ;. using System
0160: 2e 44 61 74 61 3b 0a 20 20 75 73 69 6e 67 20 53 .Data;. using S
0170: 79 73 74 65 6d 2e 52 75 6e 74 69 6d 65 2e 49 6e ystem.Runtime.In
0180: 74 65 72 6f 70 53 65 72 76 69 63 65 73 3b 0a 20 teropServices;.
0190: 20 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 43 6f using System.Co
01a0: 6c 6c 65 63 74 69 6f 6e 73 2e 47 65 6e 65 72 69 llections.Generi
01b0: 63 3b 0a 0a 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 c;.. /// <summa
01c0: 72 79 3e 0a 20 20 2f 2f 2f 20 54 68 69 73 20 69 ry>. /// This i
01d0: 6e 74 65 72 6e 61 6c 20 63 6c 61 73 73 20 70 72 nternal class pr
01e0: 6f 76 69 64 65 73 20 74 68 65 20 66 6f 75 6e 64 ovides the found
01f0: 61 74 69 6f 6e 20 6f 66 20 53 51 4c 69 74 65 20 ation of SQLite
0200: 73 75 70 70 6f 72 74 2e 20 20 49 74 20 64 65 66 support. It def
0210: 69 6e 65 73 20 61 6c 6c 20 74 68 65 20 61 62 73 ines all the abs
0220: 74 72 61 63 74 20 6d 65 6d 62 65 72 73 20 6e 65 tract members ne
0230: 65 64 65 64 20 74 6f 20 69 6d 70 6c 65 6d 65 6e eded to implemen
0240: 74 0a 20 20 2f 2f 2f 20 61 20 53 51 4c 69 74 65 t. /// a SQLite
0250: 20 64 61 74 61 20 70 72 6f 76 69 64 65 72 2c 20 data provider,
0260: 61 6e 64 20 69 6e 68 65 72 69 74 73 20 66 72 6f and inherits fro
0270: 6d 20 53 51 4c 69 74 65 43 6f 6e 76 65 72 74 20 m SQLiteConvert
0280: 77 68 69 63 68 20 61 6c 6c 6f 77 73 20 66 6f 72 which allows for
0290: 20 73 69 6d 70 6c 65 20 74 72 61 6e 73 6c 61 74 simple translat
02a0: 69 6f 6e 73 20 6f 66 20 73 74 72 69 6e 67 20 74 ions of string t
02b0: 6f 20 61 6e 64 20 66 72 6f 6d 20 53 51 4c 69 74 o and from SQLit
02c0: 65 2e 0a 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 e.. /// </summa
02d0: 72 79 3e 0a 20 20 69 6e 74 65 72 6e 61 6c 20 61 ry>. internal a
02e0: 62 73 74 72 61 63 74 20 63 6c 61 73 73 20 53 51 bstract class SQ
02f0: 4c 69 74 65 42 61 73 65 20 3a 20 53 51 4c 69 74 LiteBase : SQLit
0300: 65 43 6f 6e 76 65 72 74 2c 20 49 44 69 73 70 6f eConvert, IDispo
0310: 73 61 62 6c 65 0a 20 20 7b 0a 20 20 20 20 69 6e sable. {. in
0320: 74 65 72 6e 61 6c 20 53 51 4c 69 74 65 42 61 73 ternal SQLiteBas
0330: 65 28 53 51 4c 69 74 65 44 61 74 65 46 6f 72 6d e(SQLiteDateForm
0340: 61 74 73 20 66 6d 74 29 0a 20 20 20 20 20 20 3a ats fmt). :
0350: 20 62 61 73 65 28 66 6d 74 29 20 7b 7d 0a 0a 20 base(fmt) {}..
0360: 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e /// <summary>
0370: 0a 20 20 20 20 2f 2f 2f 20 52 65 74 75 72 6e 73 . /// Returns
0380: 20 61 20 73 74 72 69 6e 67 20 72 65 70 72 65 73 a string repres
0390: 65 6e 74 69 6e 67 20 74 68 65 20 61 63 74 69 76 enting the activ
03a0: 65 20 76 65 72 73 69 6f 6e 20 6f 66 20 53 51 4c e version of SQL
03b0: 69 74 65 0a 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 ite. /// </su
03c0: 6d 6d 61 72 79 3e 0a 20 20 20 20 69 6e 74 65 72 mmary>. inter
03d0: 6e 61 6c 20 61 62 73 74 72 61 63 74 20 73 74 72 nal abstract str
03e0: 69 6e 67 20 56 65 72 73 69 6f 6e 20 7b 20 67 65 ing Version { ge
03f0: 74 3b 20 7d 0a 20 20 20 20 2f 2f 2f 20 3c 73 75 t; }. /// <su
0400: 6d 6d 61 72 79 3e 0a 20 20 20 20 2f 2f 2f 20 52 mmary>. /// R
0410: 65 74 75 72 6e 73 20 74 68 65 20 6e 75 6d 62 65 eturns the numbe
0420: 72 20 6f 66 20 63 68 61 6e 67 65 73 20 74 68 65 r of changes the
0430: 20 6c 61 73 74 20 65 78 65 63 75 74 69 6e 67 20 last executing
0440: 69 6e 73 65 72 74 2f 75 70 64 61 74 65 20 63 61 insert/update ca
0450: 75 73 65 64 2e 0a 20 20 20 20 2f 2f 2f 20 3c 2f used.. /// </
0460: 73 75 6d 6d 61 72 79 3e 0a 20 20 20 20 69 6e 74 summary>. int
0470: 65 72 6e 61 6c 20 61 62 73 74 72 61 63 74 20 69 ernal abstract i
0480: 6e 74 20 20 20 20 43 68 61 6e 67 65 73 20 7b 20 nt Changes {
0490: 67 65 74 3b 20 7d 0a 20 20 20 20 2f 2f 2f 20 3c get; }. /// <
04a0: 73 75 6d 6d 61 72 79 3e 0a 20 20 20 20 2f 2f 2f summary>. ///
04b0: 20 4f 70 65 6e 73 20 61 20 64 61 74 61 62 61 73 Opens a databas
04c0: 65 2e 0a 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d e.. /// </sum
04d0: 6d 61 72 79 3e 0a 20 20 20 20 2f 2f 2f 20 3c 72 mary>. /// <r
04e0: 65 6d 61 72 6b 73 3e 0a 20 20 20 20 2f 2f 2f 20 emarks>. ///
04f0: 49 6d 70 6c 65 6d 65 6e 74 65 72 73 20 73 68 6f Implementers sho
0500: 75 6c 64 20 63 61 6c 6c 20 53 51 4c 69 74 65 46 uld call SQLiteF
0510: 75 6e 63 74 69 6f 6e 2e 42 69 6e 64 46 75 6e 63 unction.BindFunc
0520: 74 69 6f 6e 73 28 29 20 61 6e 64 20 73 61 76 65 tions() and save
0530: 20 74 68 65 20 61 72 72 61 79 20 61 66 74 65 72 the array after
0540: 20 6f 70 65 6e 69 6e 67 20 61 20 63 6f 6e 6e 65 opening a conne
0550: 63 74 69 6f 6e 0a 20 20 20 20 2f 2f 2f 20 74 6f ction. /// to
0560: 20 62 69 6e 64 20 61 6c 6c 20 61 74 74 72 69 62 bind all attrib
0570: 75 74 65 64 20 75 73 65 72 2d 64 65 66 69 6e 65 uted user-define
0580: 64 20 66 75 6e 63 74 69 6f 6e 73 20 61 6e 64 20 d functions and
0590: 63 6f 6c 6c 61 74 69 6e 67 20 73 65 71 75 65 6e collating sequen
05a0: 63 65 73 20 74 6f 20 74 68 65 20 6e 65 77 20 63 ces to the new c
05b0: 6f 6e 6e 65 63 74 69 6f 6e 2e 0a 20 20 20 20 2f onnection.. /
05c0: 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0a 20 20 // </remarks>.
05d0: 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d /// <param nam
05e0: 65 3d 22 73 74 72 46 69 6c 65 6e 61 6d 65 22 3e e="strFilename">
05f0: 54 68 65 20 66 69 6c 65 6e 61 6d 65 20 6f 66 20 The filename of
0600: 74 68 65 20 64 61 74 61 62 61 73 65 20 74 6f 20 the database to
0610: 6f 70 65 6e 2e 20 20 53 51 4c 69 74 65 20 61 75 open. SQLite au
0620: 74 6f 6d 61 74 69 63 61 6c 6c 79 20 63 72 65 61 tomatically crea
0630: 74 65 73 20 69 74 20 69 66 20 69 74 20 64 6f 65 tes it if it doe
0640: 73 6e 27 74 20 65 78 69 73 74 2e 3c 2f 70 61 72 sn't exist.</par
0650: 61 6d 3e 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c am>. internal
0660: 20 61 62 73 74 72 61 63 74 20 76 6f 69 64 20 20 abstract void
0670: 20 4f 70 65 6e 28 73 74 72 69 6e 67 20 73 74 72 Open(string str
0680: 46 69 6c 65 6e 61 6d 65 29 3b 0a 20 20 20 20 2f Filename);. /
0690: 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0a 20 20 20 // <summary>.
06a0: 20 2f 2f 2f 20 43 6c 6f 73 65 73 20 74 68 65 20 /// Closes the
06b0: 63 75 72 72 65 6e 74 6c 79 2d 6f 70 65 6e 20 64 currently-open d
06c0: 61 74 61 62 61 73 65 2e 0a 20 20 20 20 2f 2f 2f atabase.. ///
06d0: 20 3c 2f 73 75 6d 6d 61 72 79 3e 0a 20 20 20 20 </summary>.
06e0: 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0a 20 20 /// <remarks>.
06f0: 20 20 2f 2f 2f 20 41 66 74 65 72 20 74 68 65 20 /// After the
0700: 64 61 74 61 62 61 73 65 20 68 61 73 20 62 65 65 database has bee
0710: 6e 20 63 6c 6f 73 65 64 20 69 6d 70 6c 65 6d 65 n closed impleme
0720: 74 65 72 73 20 73 68 6f 75 6c 64 20 63 61 6c 6c ters should call
0730: 20 53 51 4c 69 74 65 46 75 6e 63 74 69 6f 6e 2e SQLiteFunction.
0740: 55 6e 62 69 6e 64 46 75 6e 63 74 69 6f 6e 73 28 UnbindFunctions(
0750: 29 20 74 6f 20 64 65 61 6c 6c 6f 63 61 74 65 20 ) to deallocate
0760: 61 6c 6c 20 69 6e 74 65 72 6f 70 20 61 6c 6c 6f all interop allo
0770: 63 61 74 65 64 0a 20 20 20 20 2f 2f 2f 20 6d 65 cated. /// me
0780: 6d 6f 72 79 20 61 73 73 6f 63 69 61 74 65 64 20 mory associated
0790: 77 69 74 68 20 74 68 65 20 75 73 65 72 2d 64 65 with the user-de
07a0: 66 69 6e 65 64 20 66 75 6e 63 74 69 6f 6e 73 20 fined functions
07b0: 61 6e 64 20 63 6f 6c 6c 61 74 69 6e 67 20 73 65 and collating se
07c0: 71 75 65 6e 63 65 73 20 74 69 65 64 20 74 6f 20 quences tied to
07d0: 74 68 65 20 63 6c 6f 73 65 64 20 63 6f 6e 6e 65 the closed conne
07e0: 63 74 69 6f 6e 2e 0a 20 20 20 20 2f 2f 2f 20 3c ction.. /// <
07f0: 2f 72 65 6d 61 72 6b 73 3e 0a 20 20 20 20 69 6e /remarks>. in
0800: 74 65 72 6e 61 6c 20 61 62 73 74 72 61 63 74 20 ternal abstract
0810: 76 6f 69 64 20 20 20 43 6c 6f 73 65 28 29 3b 0a void Close();.
0820: 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 /// <summary
0830: 3e 0a 20 20 20 20 2f 2f 2f 20 53 65 74 73 20 74 >. /// Sets t
0840: 68 65 20 62 75 73 79 20 74 69 6d 65 6f 75 74 20 he busy timeout
0850: 6f 6e 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f on the connectio
0860: 6e 2e 20 20 53 51 4c 69 74 65 43 6f 6d 6d 61 6e n. SQLiteComman
0870: 64 20 77 69 6c 6c 20 63 61 6c 6c 20 74 68 69 73 d will call this
0880: 20 62 65 66 6f 72 65 20 65 78 65 63 75 74 69 6e before executin
0890: 67 20 61 6e 79 20 63 6f 6d 6d 61 6e 64 2e 0a 20 g any command..
08a0: 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 /// </summary
08b0: 3e 0a 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d >. /// <param
08c0: 20 6e 61 6d 65 3d 22 6e 54 69 6d 65 6f 75 74 4d name="nTimeoutM
08d0: 53 22 3e 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 S">The number of
08e0: 20 6d 69 6c 6c 69 73 65 63 6f 6e 64 73 20 74 6f milliseconds to
08f0: 20 77 61 69 74 20 62 65 66 6f 72 65 20 72 65 74 wait before ret
0900: 75 72 6e 69 6e 67 20 53 51 4c 49 54 45 5f 42 55 urning SQLITE_BU
0910: 53 59 3c 2f 70 61 72 61 6d 3e 0a 20 20 20 20 69 SY</param>. i
0920: 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 61 63 74 nternal abstract
0930: 20 76 6f 69 64 20 20 20 53 65 74 54 69 6d 65 6f void SetTimeo
0940: 75 74 28 69 6e 74 20 6e 54 69 6d 65 6f 75 74 4d ut(int nTimeoutM
0950: 53 29 3b 0a 20 20 20 20 2f 2f 2f 20 3c 73 75 6d S);. /// <sum
0960: 6d 61 72 79 3e 0a 20 20 20 20 2f 2f 2f 20 51 75 mary>. /// Qu
0970: 69 63 6b 20 65 78 65 63 75 74 65 20 6f 66 20 61 ick execute of a
0980: 20 53 51 4c 20 63 6f 6d 6d 61 6e 64 2e 20 20 54 SQL command. T
0990: 68 69 73 20 69 73 20 6f 6e 6c 79 20 65 78 65 63 his is only exec
09a0: 75 74 65 64 20 69 6e 74 65 72 6e 61 6c 6c 79 2c uted internally,
09b0: 20 75 73 75 61 6c 6c 79 20 62 79 20 53 51 4c 69 usually by SQLi
09c0: 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 20 77 68 65 teConnection whe
09d0: 6e 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e n the connection
09e0: 0a 20 20 20 20 2f 2f 2f 20 69 73 20 66 69 72 73 . /// is firs
09f0: 74 20 6f 70 65 6e 65 64 20 74 6f 20 73 65 74 20 t opened to set
0a00: 74 68 65 20 6e 65 63 65 73 73 61 72 79 20 73 74 the necessary st
0a10: 61 72 74 75 70 20 70 72 61 67 6d 61 73 2e 0a 20 artup pragmas..
0a20: 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 /// </summary
0a30: 3e 0a 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d >. /// <param
0a40: 20 6e 61 6d 65 3d 22 73 74 72 53 71 6c 22 3e 54 name="strSql">T
0a50: 68 65 20 53 51 4c 20 63 6f 6d 6d 61 6e 64 20 74 he SQL command t
0a60: 65 78 74 20 74 6f 20 65 78 65 63 75 74 65 3c 2f ext to execute</
0a70: 70 61 72 61 6d 3e 0a 20 20 20 20 69 6e 74 65 72 param>. inter
0a80: 6e 61 6c 20 61 62 73 74 72 61 63 74 20 76 6f 69 nal abstract voi
0a90: 64 20 20 20 45 78 65 63 75 74 65 28 73 74 72 69 d Execute(stri
0aa0: 6e 67 20 73 74 72 53 71 6c 29 3b 0a 20 20 20 20 ng strSql);.
0ab0: 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0a 20 20 /// <summary>.
0ac0: 20 20 2f 2f 2f 20 52 65 74 75 72 6e 73 20 74 68 /// Returns th
0ad0: 65 20 74 65 78 74 20 6f 66 20 74 68 65 20 6c 61 e text of the la
0ae0: 73 74 20 65 72 72 6f 72 20 69 73 73 75 65 64 20 st error issued
0af0: 62 79 20 53 51 4c 69 74 65 0a 20 20 20 20 2f 2f by SQLite. //
0b00: 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0a 20 20 20 / </summary>.
0b10: 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f /// <returns></
0b20: 72 65 74 75 72 6e 73 3e 0a 20 20 20 20 69 6e 74 returns>. int
0b30: 65 72 6e 61 6c 20 61 62 73 74 72 61 63 74 20 73 ernal abstract s
0b40: 74 72 69 6e 67 20 53 51 4c 69 74 65 4c 61 73 74 tring SQLiteLast
0b50: 45 72 72 6f 72 28 29 3b 0a 0a 20 20 20 20 2f 2f Error();.. //
0b60: 2f 20 3c 73 75 6d 6d 61 72 79 3e 0a 20 20 20 20 / <summary>.
0b70: 2f 2f 2f 20 50 72 65 70 61 72 65 73 20 61 20 53 /// Prepares a S
0b80: 51 4c 20 73 74 61 74 65 6d 65 6e 74 20 66 6f 72 QL statement for
0b90: 20 65 78 65 63 75 74 69 6f 6e 2e 0a 20 20 20 20 execution..
0ba0: 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0a 20 /// </summary>.
0bb0: 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 /// <param na
0bc0: 6d 65 3d 22 73 74 72 53 71 6c 22 3e 54 68 65 20 me="strSql">The
0bd0: 53 51 4c 20 63 6f 6d 6d 61 6e 64 20 74 65 78 74 SQL command text
0be0: 20 74 6f 20 70 72 65 70 61 72 65 3c 2f 70 61 72 to prepare</par
0bf0: 61 6d 3e 0a 20 20 20 20 2f 2f 2f 20 3c 70 61 72 am>. /// <par
0c00: 61 6d 20 6e 61 6d 65 3d 22 6e 50 61 72 61 6d 53 am name="nParamS
0c10: 74 61 72 74 22 3e 57 68 65 6e 20 70 72 65 70 61 tart">When prepa
0c20: 72 69 6e 67 20 6d 75 6c 74 69 70 6c 65 20 73 74 ring multiple st
0c30: 61 74 65 6d 65 6e 74 73 20 74 68 61 74 20 61 72 atements that ar
0c40: 65 20 74 69 65 64 20 74 6f 67 65 74 68 65 72 20 e tied together
0c50: 69 6e 74 6f 20 61 20 73 69 6e 67 6c 65 20 63 6f into a single co
0c60: 6d 6d 61 6e 64 2c 0a 20 20 20 20 2f 2f 2f 20 74 mmand,. /// t
0c70: 68 69 73 20 76 61 6c 75 65 20 73 68 6f 75 6c 64 his value should
0c80: 20 62 65 20 69 6e 69 74 69 61 6c 69 7a 65 64 20 be initialized
0c90: 74 6f 20 30 20 66 6f 72 20 74 68 65 20 66 69 72 to 0 for the fir
0ca0: 73 74 20 73 74 61 74 65 6d 65 6e 74 20 70 72 65 st statement pre
0cb0: 70 61 72 65 64 2e 20 20 4f 6e 20 72 65 74 75 72 pared. On retur
0cc0: 6e 20 66 72 6f 6d 20 74 68 69 73 20 66 75 6e 63 n from this func
0cd0: 74 69 6f 6e 2c 20 74 68 65 0a 20 20 20 20 2f 2f tion, the. //
0ce0: 2f 20 76 61 72 69 61 62 6c 65 20 77 69 6c 6c 20 / variable will
0cf0: 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 62 65 automatically be
0d00: 20 69 6e 63 72 65 6d 65 6e 74 65 64 20 62 79 20 incremented by
0d10: 31 20 66 6f 72 20 65 61 63 68 20 75 6e 6e 61 6d 1 for each unnam
0d20: 65 64 20 70 61 72 61 6d 65 74 65 72 20 74 68 61 ed parameter tha
0d30: 74 20 6f 63 63 75 72 72 65 64 20 69 6e 20 74 68 t occurred in th
0d40: 65 20 73 74 61 74 65 6d 65 6e 74 2e 0a 20 20 20 e statement..
0d50: 20 2f 2f 2f 20 57 68 65 6e 20 69 6d 70 6c 65 6d /// When implem
0d60: 65 6e 74 69 6e 67 20 74 68 69 73 20 66 75 6e 63 enting this func
0d70: 74 69 6f 6e 2c 20 6f 6e 65 20 6e 65 65 64 20 6f tion, one need o
0d80: 6e 6c 79 20 70 61 73 73 20 74 68 65 20 6e 50 61 nly pass the nPa
0d90: 72 61 6d 53 74 61 72 74 20 76 61 72 69 61 62 6c ramStart variabl
0da0: 65 20 62 79 20 72 65 66 65 72 65 6e 63 65 20 74 e by reference t
0db0: 6f 20 74 68 65 20 53 51 4c 69 74 65 53 74 61 74 o the SQLiteStat
0dc0: 65 6d 65 6e 74 28 29 0a 20 20 20 20 2f 2f 2f 20 ement(). ///
0dd0: 63 6f 6e 73 74 72 75 63 74 6f 72 2e 20 20 53 51 constructor. SQ
0de0: 4c 69 74 65 53 74 61 74 65 6d 65 6e 74 20 77 69 LiteStatement wi
0df0: 6c 6c 20 74 61 6b 65 20 63 61 72 65 20 6f 66 20 ll take care of
0e00: 69 74 2e 3c 2f 70 61 72 61 6d 3e 0a 20 20 20 20 it.</param>.
0e10: 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d /// <param name=
0e20: 22 73 74 72 52 65 6d 61 69 6e 22 3e 54 68 65 20 "strRemain">The
0e30: 72 65 6d 61 69 6e 64 65 72 20 6f 66 20 74 68 65 remainder of the
0e40: 20 73 74 61 74 65 6d 65 6e 74 20 74 68 61 74 20 statement that
0e50: 77 61 73 20 6e 6f 74 20 70 72 6f 63 65 73 73 65 was not processe
0e60: 64 2e 20 20 45 61 63 68 20 63 61 6c 6c 20 74 6f d. Each call to
0e70: 20 70 72 65 70 61 72 65 20 70 61 72 73 65 73 20 prepare parses
0e80: 74 68 65 0a 20 20 20 20 2f 2f 2f 20 53 51 4c 20 the. /// SQL
0e90: 75 70 20 74 6f 20 74 6f 20 65 69 74 68 65 72 20 up to to either
0ea0: 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 74 the end of the t
0eb0: 65 78 74 20 6f 72 20 74 6f 20 74 68 65 20 66 69 ext or to the fi
0ec0: 72 73 74 20 73 65 6d 69 2d 63 6f 6c 6f 6e 20 64 rst semi-colon d
0ed0: 65 6c 69 6d 69 74 65 72 2e 20 20 54 68 65 20 72 elimiter. The r
0ee0: 65 6d 61 69 6e 69 6e 67 20 74 65 78 74 20 69 73 emaining text is
0ef0: 20 72 65 74 75 72 6e 65 64 0a 20 20 20 20 2f 2f returned. //
0f00: 2f 20 68 65 72 65 20 66 6f 72 20 61 20 73 75 62 / here for a sub
0f10: 73 65 71 75 65 6e 74 20 63 61 6c 6c 20 74 6f 20 sequent call to
0f20: 50 72 65 70 61 72 65 28 29 20 75 6e 74 69 6c 20 Prepare() until
0f30: 61 6c 6c 20 74 68 65 20 74 65 78 74 20 68 61 73 all the text has
0f40: 20 62 65 65 6e 20 70 72 6f 63 65 73 73 65 64 2e been processed.
0f50: 3c 2f 70 61 72 61 6d 3e 0a 20 20 20 20 2f 2f 2f </param>. ///
0f60: 20 3c 72 65 74 75 72 6e 73 3e 52 65 74 75 72 6e <returns>Return
0f70: 73 20 61 6e 20 69 6e 69 74 69 61 6c 69 7a 65 64 s an initialized
0f80: 20 53 51 4c 69 74 65 53 74 61 74 65 6d 65 6e 74 SQLiteStatement
0f90: 2e 3c 2f 72 65 74 75 72 6e 73 3e 0a 20 20 20 20 .</returns>.
0fa0: 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 61 63 internal abstrac
0fb0: 74 20 53 51 4c 69 74 65 53 74 61 74 65 6d 65 6e t SQLiteStatemen
0fc0: 74 20 50 72 65 70 61 72 65 28 73 74 72 69 6e 67 t Prepare(string
0fd0: 20 73 74 72 53 71 6c 2c 20 72 65 66 20 69 6e 74 strSql, ref int
0fe0: 20 6e 50 61 72 61 6d 53 74 61 72 74 2c 20 6f 75 nParamStart, ou
0ff0: 74 20 73 74 72 69 6e 67 20 73 74 72 52 65 6d 61 t string strRema
1000: 69 6e 29 3b 0a 20 20 20 20 2f 2f 2f 20 3c 73 75 in);. /// <su
1010: 6d 6d 61 72 79 3e 0a 20 20 20 20 2f 2f 2f 20 53 mmary>. /// S
1020: 74 65 70 73 20 74 68 72 6f 75 67 68 20 61 20 70 teps through a p
1030: 72 65 70 61 72 65 64 20 73 74 61 74 65 6d 65 6e repared statemen
1040: 74 2e 0a 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d t.. /// </sum
1050: 6d 61 72 79 3e 0a 20 20 20 20 2f 2f 2f 20 3c 70 mary>. /// <p
1060: 61 72 61 6d 20 6e 61 6d 65 3d 22 73 74 6d 74 22 aram name="stmt"
1070: 3e 54 68 65 20 53 51 4c 69 74 65 53 74 61 74 65 >The SQLiteState
1080: 6d 65 6e 74 20 74 6f 20 73 74 65 70 20 74 68 72 ment to step thr
1090: 6f 75 67 68 3c 2f 70 61 72 61 6d 3e 0a 20 20 20 ough</param>.
10a0: 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 72 /// <returns>Tr
10b0: 75 65 20 69 66 20 61 20 72 6f 77 20 77 61 73 20 ue if a row was
10c0: 72 65 74 75 72 6e 65 64 2c 20 46 61 6c 73 65 20 returned, False
10d0: 69 66 20 6e 6f 74 2e 3c 2f 72 65 74 75 72 6e 73 if not.</returns
10e0: 3e 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 61 >. internal a
10f0: 62 73 74 72 61 63 74 20 62 6f 6f 6c 20 53 74 65 bstract bool Ste
1100: 70 28 53 51 4c 69 74 65 53 74 61 74 65 6d 65 6e p(SQLiteStatemen
1110: 74 20 73 74 6d 74 29 3b 0a 20 20 20 20 2f 2f 2f t stmt);. ///
1120: 20 3c 73 75 6d 6d 61 72 79 3e 0a 20 20 20 20 2f <summary>. /
1130: 2f 2f 20 46 69 6e 61 6c 69 7a 65 73 20 61 20 70 // Finalizes a p
1140: 72 65 70 61 72 65 64 20 73 74 61 74 65 6d 65 6e repared statemen
1150: 74 2e 0a 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d t.. /// </sum
1160: 6d 61 72 79 3e 0a 20 20 20 20 2f 2f 2f 20 3c 70 mary>. /// <p
1170: 61 72 61 6d 20 6e 61 6d 65 3d 22 73 74 6d 74 22 aram name="stmt"
1180: 3e 54 68 65 20 73 74 61 74 65 6d 65 6e 74 20 74 >The statement t
1190: 6f 20 66 69 6e 61 6c 69 7a 65 3c 2f 70 61 72 61 o finalize</para
11a0: 6d 3e 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 m>. internal
11b0: 61 62 73 74 72 61 63 74 20 76 6f 69 64 20 46 69 abstract void Fi
11c0: 6e 61 6c 69 7a 65 53 74 61 74 65 6d 65 6e 74 28 nalizeStatement(
11d0: 53 51 4c 69 74 65 53 74 61 74 65 6d 65 6e 74 20 SQLiteStatement
11e0: 73 74 6d 74 29 3b 0a 20 20 20 20 2f 2f 2f 20 3c stmt);. /// <
11f0: 73 75 6d 6d 61 72 79 3e 0a 20 20 20 20 2f 2f 2f summary>. ///
1200: 20 52 65 73 65 74 73 20 61 20 70 72 65 70 61 72 Resets a prepar
1210: 65 64 20 73 74 61 74 65 6d 65 6e 74 20 73 6f 20 ed statement so
1220: 69 74 20 63 61 6e 20 62 65 20 65 78 65 63 75 74 it can be execut
1230: 65 64 20 61 67 61 69 6e 2e 20 20 49 66 20 74 68 ed again. If th
1240: 65 20 65 72 72 6f 72 20 72 65 74 75 72 6e 65 64 e error returned
1250: 20 69 73 20 53 51 4c 49 54 45 5f 53 43 48 45 4d is SQLITE_SCHEM
1260: 41 2c 20 0a 20 20 20 20 2f 2f 2f 20 74 72 61 6e A, . /// tran
1270: 73 70 61 72 65 6e 74 6c 79 20 61 74 74 65 6d 70 sparently attemp
1280: 74 20 74 6f 20 72 65 62 75 69 6c 64 20 74 68 65 t to rebuild the
1290: 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 20 61 SQL statement a
12a0: 6e 64 20 74 68 72 6f 77 20 61 6e 20 65 72 72 6f nd throw an erro
12b0: 72 20 69 66 20 74 68 61 74 20 77 61 73 20 6e 6f r if that was no
12c0: 74 20 70 6f 73 73 69 62 6c 65 2e 0a 20 20 20 20 t possible..
12d0: 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0a 20 /// </summary>.
12e0: 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 /// <param na
12f0: 6d 65 3d 22 73 74 6d 74 22 3e 54 68 65 20 73 74 me="stmt">The st
1300: 61 74 65 6d 65 6e 74 20 74 6f 20 72 65 73 65 74 atement to reset
1310: 3c 2f 70 61 72 61 6d 3e 0a 20 20 20 20 2f 2f 2f </param>. ///
1320: 20 3c 72 65 74 75 72 6e 73 3e 52 65 74 75 72 6e <returns>Return
1330: 73 20 2d 31 20 69 66 20 74 68 65 20 73 63 68 65 s -1 if the sche
1340: 6d 61 20 63 68 61 6e 67 65 64 20 77 68 69 6c 65 ma changed while
1350: 20 72 65 73 65 74 74 69 6e 67 2c 20 30 20 69 66 resetting, 0 if
1360: 20 74 68 65 20 72 65 73 65 74 20 77 61 73 20 73 the reset was s
1370: 75 63 65 73 73 66 75 6c 20 6f 72 20 36 20 28 53 ucessful or 6 (S
1380: 51 4c 49 54 45 5f 4c 4f 43 4b 45 44 29 20 69 66 QLITE_LOCKED) if
1390: 20 74 68 65 20 72 65 73 65 74 20 66 61 69 6c 65 the reset faile
13a0: 64 20 64 75 65 20 74 6f 20 61 20 6c 6f 63 6b 3c d due to a lock<
13b0: 2f 72 65 74 75 72 6e 73 3e 0a 20 20 20 20 69 6e /returns>. in
13c0: 74 65 72 6e 61 6c 20 61 62 73 74 72 61 63 74 20 ternal abstract
13d0: 69 6e 74 20 52 65 73 65 74 28 53 51 4c 69 74 65 int Reset(SQLite
13e0: 53 74 61 74 65 6d 65 6e 74 20 73 74 6d 74 29 3b Statement stmt);
13f0: 0a 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 61 .. internal a
1400: 62 73 74 72 61 63 74 20 76 6f 69 64 20 43 61 6e bstract void Can
1410: 63 65 6c 28 29 3b 0a 0a 20 20 20 20 2f 2f 2f 20 cel();.. ///
1420: 3c 73 75 6d 6d 61 72 79 3e 0a 20 20 20 20 2f 2f <summary>. //
1430: 2f 20 41 6e 20 69 6e 74 65 72 6f 70 2d 73 70 65 / An interop-spe
1440: 63 69 66 69 63 20 66 75 6e 63 74 69 6f 6e 2c 20 cific function,
1450: 74 68 69 73 20 63 61 6c 6c 20 73 65 74 73 20 61 this call sets a
1460: 6e 20 69 6e 74 65 72 6e 61 6c 20 66 6c 61 67 20 n internal flag
1470: 69 6e 20 74 68 65 20 73 71 6c 69 74 65 2e 69 6e in the sqlite.in
1480: 74 65 72 6f 70 2e 64 6c 6c 20 77 68 69 63 68 20 terop.dll which
1490: 63 61 75 73 65 73 20 61 6c 6c 20 63 6f 6c 75 6d causes all colum
14a0: 6e 20 6e 61 6d 65 73 0a 20 20 20 20 2f 2f 2f 20 n names. ///
14b0: 6f 66 20 73 75 62 73 65 71 75 65 6e 74 6c 79 2d of subsequently-
14c0: 70 72 65 70 61 72 65 64 20 73 74 61 74 65 6d 65 prepared stateme
14d0: 6e 74 73 20 74 6f 20 72 65 74 75 72 6e 20 69 6e nts to return in
14e0: 20 44 61 74 61 62 61 73 65 2e 54 61 62 6c 65 2e Database.Table.
14f0: 43 6f 6c 75 6d 6e 20 66 6f 72 6d 61 74 2c 20 69 Column format, i
1500: 67 6e 6f 72 69 6e 67 20 61 6c 6c 20 61 6c 69 61 gnoring all alia
1510: 73 65 73 20 74 68 61 74 20 6d 61 79 20 68 61 76 ses that may hav
1520: 65 20 62 65 65 6e 20 61 70 70 6c 69 65 64 0a 20 e been applied.
1530: 20 20 20 2f 2f 2f 20 74 6f 20 74 61 62 6c 65 73 /// to tables
1540: 20 6f 72 20 63 6f 6c 75 6d 6e 73 20 69 6e 20 61 or columns in a
1550: 20 72 65 73 75 6c 74 73 65 74 2e 0a 20 20 20 20 resultset..
1560: 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0a 20 /// </summary>.
1570: 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e /// <remarks>
1580: 0a 20 20 20 20 2f 2f 2f 20 41 6c 6c 20 73 74 61 . /// All sta
1590: 74 65 6d 65 6e 74 73 20 70 72 65 70 61 72 65 64 tements prepared
15a0: 20 6f 6e 20 74 68 69 73 20 63 6f 6e 6e 65 63 74 on this connect
15b0: 69 6f 6e 20 61 66 74 65 72 20 74 68 69 73 20 66 ion after this f
15c0: 6c 61 67 20 69 73 20 63 68 61 6e 67 65 64 20 61 lag is changed a
15d0: 72 65 20 61 66 66 65 63 74 65 64 2e 20 20 45 78 re affected. Ex
15e0: 69 73 74 69 6e 67 20 73 74 61 74 65 6d 65 6e 74 isting statement
15f0: 73 20 61 72 65 20 6e 6f 74 2e 0a 20 20 20 20 2f s are not.. /
1600: 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0a 20 20 // </remarks>.
1610: 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d /// <param nam
1620: 65 3d 22 62 4f 6e 22 3e 53 65 74 20 74 6f 20 54 e="bOn">Set to T
1630: 72 75 65 20 74 6f 20 65 6e 61 62 6c 65 20 72 65 rue to enable re
1640: 61 6c 20 63 6f 6c 75 6d 6e 20 6e 61 6d 65 73 2c al column names,
1650: 20 66 61 6c 73 65 20 74 6f 20 64 69 73 61 62 6c false to disabl
1660: 65 20 74 68 65 6d 2e 3c 2f 70 61 72 61 6d 3e 0a e them.</param>.
1670: 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 internal abs
1680: 74 72 61 63 74 20 76 6f 69 64 20 53 65 74 52 65 tract void SetRe
1690: 61 6c 43 6f 6c 4e 61 6d 65 73 28 62 6f 6f 6c 20 alColNames(bool
16a0: 62 4f 6e 29 3b 0a 0a 20 20 20 20 69 6e 74 65 72 bOn);.. inter
16b0: 6e 61 6c 20 61 62 73 74 72 61 63 74 20 76 6f 69 nal abstract voi
16c0: 64 20 42 69 6e 64 5f 44 6f 75 62 6c 65 28 53 51 d Bind_Double(SQ
16d0: 4c 69 74 65 53 74 61 74 65 6d 65 6e 74 20 73 74 LiteStatement st
16e0: 6d 74 2c 20 69 6e 74 20 69 6e 64 65 78 2c 20 64 mt, int index, d
16f0: 6f 75 62 6c 65 20 76 61 6c 75 65 29 3b 0a 20 20 ouble value);.
1700: 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 internal abstr
1710: 61 63 74 20 76 6f 69 64 20 42 69 6e 64 5f 49 6e act void Bind_In
1720: 74 33 32 28 53 51 4c 69 74 65 53 74 61 74 65 6d t32(SQLiteStatem
1730: 65 6e 74 20 73 74 6d 74 2c 20 69 6e 74 20 69 6e ent stmt, int in
1740: 64 65 78 2c 20 49 6e 74 33 32 20 76 61 6c 75 65 dex, Int32 value
1750: 29 3b 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 );. internal
1760: 61 62 73 74 72 61 63 74 20 76 6f 69 64 20 42 69 abstract void Bi
1770: 6e 64 5f 49 6e 74 36 34 28 53 51 4c 69 74 65 53 nd_Int64(SQLiteS
1780: 74 61 74 65 6d 65 6e 74 20 73 74 6d 74 2c 20 69 tatement stmt, i
1790: 6e 74 20 69 6e 64 65 78 2c 20 49 6e 74 36 34 20 nt index, Int64
17a0: 76 61 6c 75 65 29 3b 0a 20 20 20 20 69 6e 74 65 value);. inte
17b0: 72 6e 61 6c 20 61 62 73 74 72 61 63 74 20 76 6f rnal abstract vo
17c0: 69 64 20 42 69 6e 64 5f 54 65 78 74 28 53 51 4c id Bind_Text(SQL
17d0: 69 74 65 53 74 61 74 65 6d 65 6e 74 20 73 74 6d iteStatement stm
17e0: 74 2c 20 69 6e 74 20 69 6e 64 65 78 2c 20 73 74 t, int index, st
17f0: 72 69 6e 67 20 76 61 6c 75 65 29 3b 0a 20 20 20 ring value);.
1800: 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 61 internal abstra
1810: 63 74 20 76 6f 69 64 20 42 69 6e 64 5f 42 6c 6f ct void Bind_Blo
1820: 62 28 53 51 4c 69 74 65 53 74 61 74 65 6d 65 6e b(SQLiteStatemen
1830: 74 20 73 74 6d 74 2c 20 69 6e 74 20 69 6e 64 65 t stmt, int inde
1840: 78 2c 20 62 79 74 65 5b 5d 20 62 6c 6f 62 44 61 x, byte[] blobDa
1850: 74 61 29 3b 0a 20 20 20 20 69 6e 74 65 72 6e 61 ta);. interna
1860: 6c 20 61 62 73 74 72 61 63 74 20 76 6f 69 64 20 l abstract void
1870: 42 69 6e 64 5f 44 61 74 65 54 69 6d 65 28 53 51 Bind_DateTime(SQ
1880: 4c 69 74 65 53 74 61 74 65 6d 65 6e 74 20 73 74 LiteStatement st
1890: 6d 74 2c 20 69 6e 74 20 69 6e 64 65 78 2c 20 44 mt, int index, D
18a0: 61 74 65 54 69 6d 65 20 64 74 29 3b 0a 20 20 20 ateTime dt);.
18b0: 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 61 internal abstra
18c0: 63 74 20 76 6f 69 64 20 42 69 6e 64 5f 4e 75 6c ct void Bind_Nul
18d0: 6c 28 53 51 4c 69 74 65 53 74 61 74 65 6d 65 6e l(SQLiteStatemen
18e0: 74 20 73 74 6d 74 2c 20 69 6e 74 20 69 6e 64 65 t stmt, int inde
18f0: 78 29 3b 0a 0a 20 20 20 20 69 6e 74 65 72 6e 61 x);.. interna
1900: 6c 20 61 62 73 74 72 61 63 74 20 69 6e 74 20 20 l abstract int
1910: 20 20 42 69 6e 64 5f 50 61 72 61 6d 43 6f 75 6e Bind_ParamCoun
1920: 74 28 53 51 4c 69 74 65 53 74 61 74 65 6d 65 6e t(SQLiteStatemen
1930: 74 20 73 74 6d 74 29 3b 0a 20 20 20 20 69 6e 74 t stmt);. int
1940: 65 72 6e 61 6c 20 61 62 73 74 72 61 63 74 20 73 ernal abstract s
1950: 74 72 69 6e 67 20 42 69 6e 64 5f 50 61 72 61 6d tring Bind_Param
1960: 4e 61 6d 65 28 53 51 4c 69 74 65 53 74 61 74 65 Name(SQLiteState
1970: 6d 65 6e 74 20 73 74 6d 74 2c 20 69 6e 74 20 69 ment stmt, int i
1980: 6e 64 65 78 29 3b 0a 20 20 20 20 69 6e 74 65 72 ndex);. inter
1990: 6e 61 6c 20 61 62 73 74 72 61 63 74 20 69 6e 74 nal abstract int
19a0: 20 20 20 20 42 69 6e 64 5f 50 61 72 61 6d 49 6e Bind_ParamIn
19b0: 64 65 78 28 53 51 4c 69 74 65 53 74 61 74 65 6d dex(SQLiteStatem
19c0: 65 6e 74 20 73 74 6d 74 2c 20 73 74 72 69 6e 67 ent stmt, string
19d0: 20 70 61 72 61 6d 4e 61 6d 65 29 3b 0a 0a 20 20 paramName);..
19e0: 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 internal abstr
19f0: 61 63 74 20 69 6e 74 20 20 20 20 43 6f 6c 75 6d act int Colum
1a00: 6e 43 6f 75 6e 74 28 53 51 4c 69 74 65 53 74 61 nCount(SQLiteSta
1a10: 74 65 6d 65 6e 74 20 73 74 6d 74 29 3b 0a 20 20 tement stmt);.
1a20: 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 internal abstr
1a30: 61 63 74 20 73 74 72 69 6e 67 20 43 6f 6c 75 6d act string Colum
1a40: 6e 4e 61 6d 65 28 53 51 4c 69 74 65 53 74 61 74 nName(SQLiteStat
1a50: 65 6d 65 6e 74 20 73 74 6d 74 2c 20 69 6e 74 20 ement stmt, int
1a60: 69 6e 64 65 78 29 3b 0a 20 20 20 20 69 6e 74 65 index);. inte
1a70: 72 6e 61 6c 20 61 62 73 74 72 61 63 74 20 73 74 rnal abstract st
1a80: 72 69 6e 67 20 43 6f 6c 75 6d 6e 54 79 70 65 28 ring ColumnType(
1a90: 53 51 4c 69 74 65 53 74 61 74 65 6d 65 6e 74 20 SQLiteStatement
1aa0: 73 74 6d 74 2c 20 69 6e 74 20 69 6e 64 65 78 2c stmt, int index,
1ab0: 20 6f 75 74 20 54 79 70 65 41 66 66 69 6e 69 74 out TypeAffinit
1ac0: 79 20 6e 41 66 66 69 6e 69 74 79 29 3b 0a 20 20 y nAffinity);.
1ad0: 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 internal abstr
1ae0: 61 63 74 20 69 6e 74 20 20 20 20 43 6f 6c 75 6d act int Colum
1af0: 6e 49 6e 64 65 78 28 53 51 4c 69 74 65 53 74 61 nIndex(SQLiteSta
1b00: 74 65 6d 65 6e 74 20 73 74 6d 74 2c 20 73 74 72 tement stmt, str
1b10: 69 6e 67 20 63 6f 6c 75 6d 6e 4e 61 6d 65 29 3b ing columnName);
1b20: 0a 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 61 .. internal a
1b30: 62 73 74 72 61 63 74 20 64 6f 75 62 6c 65 20 20 bstract double
1b40: 20 47 65 74 44 6f 75 62 6c 65 28 53 51 4c 69 74 GetDouble(SQLit
1b50: 65 53 74 61 74 65 6d 65 6e 74 20 73 74 6d 74 2c eStatement stmt,
1b60: 20 69 6e 74 20 69 6e 64 65 78 29 3b 0a 20 20 20 int index);.
1b70: 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 61 internal abstra
1b80: 63 74 20 49 6e 74 33 32 20 20 20 20 47 65 74 49 ct Int32 GetI
1b90: 6e 74 33 32 28 53 51 4c 69 74 65 53 74 61 74 65 nt32(SQLiteState
1ba0: 6d 65 6e 74 20 73 74 6d 74 2c 20 69 6e 74 20 69 ment stmt, int i
1bb0: 6e 64 65 78 29 3b 0a 20 20 20 20 69 6e 74 65 72 ndex);. inter
1bc0: 6e 61 6c 20 61 62 73 74 72 61 63 74 20 49 6e 74 nal abstract Int
1bd0: 36 34 20 20 20 20 47 65 74 49 6e 74 36 34 28 53 64 GetInt64(S
1be0: 51 4c 69 74 65 53 74 61 74 65 6d 65 6e 74 20 73 QLiteStatement s
1bf0: 74 6d 74 2c 20 69 6e 74 20 69 6e 64 65 78 29 3b tmt, int index);
1c00: 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 . internal ab
1c10: 73 74 72 61 63 74 20 73 74 72 69 6e 67 20 20 20 stract string
1c20: 47 65 74 54 65 78 74 28 53 51 4c 69 74 65 53 74 GetText(SQLiteSt
1c30: 61 74 65 6d 65 6e 74 20 73 74 6d 74 2c 20 69 6e atement stmt, in
1c40: 74 20 69 6e 64 65 78 29 3b 0a 20 20 20 20 69 6e t index);. in
1c50: 74 65 72 6e 61 6c 20 61 62 73 74 72 61 63 74 20 ternal abstract
1c60: 6c 6f 6e 67 20 20 20 20 20 47 65 74 42 79 74 65 long GetByte
1c70: 73 28 53 51 4c 69 74 65 53 74 61 74 65 6d 65 6e s(SQLiteStatemen
1c80: 74 20 73 74 6d 74 2c 20 69 6e 74 20 69 6e 64 65 t stmt, int inde
1c90: 78 2c 20 69 6e 74 20 6e 44 61 74 61 6f 66 66 73 x, int nDataoffs
1ca0: 65 74 2c 20 62 79 74 65 5b 5d 20 62 44 65 73 74 et, byte[] bDest
1cb0: 2c 20 69 6e 74 20 6e 53 74 61 72 74 2c 20 69 6e , int nStart, in
1cc0: 74 20 6e 4c 65 6e 67 74 68 29 3b 0a 20 20 20 20 t nLength);.
1cd0: 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 61 63 internal abstrac
1ce0: 74 20 6c 6f 6e 67 20 20 20 20 20 47 65 74 43 68 t long GetCh
1cf0: 61 72 73 28 53 51 4c 69 74 65 53 74 61 74 65 6d ars(SQLiteStatem
1d00: 65 6e 74 20 73 74 6d 74 2c 20 69 6e 74 20 69 6e ent stmt, int in
1d10: 64 65 78 2c 20 69 6e 74 20 6e 44 61 74 61 6f 66 dex, int nDataof
1d20: 66 73 65 74 2c 20 63 68 61 72 5b 5d 20 62 44 65 fset, char[] bDe
1d30: 73 74 2c 20 69 6e 74 20 6e 53 74 61 72 74 2c 20 st, int nStart,
1d40: 69 6e 74 20 6e 4c 65 6e 67 74 68 29 3b 0a 20 20 int nLength);.
1d50: 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 internal abstr
1d60: 61 63 74 20 44 61 74 65 54 69 6d 65 20 47 65 74 act DateTime Get
1d70: 44 61 74 65 54 69 6d 65 28 53 51 4c 69 74 65 53 DateTime(SQLiteS
1d80: 74 61 74 65 6d 65 6e 74 20 73 74 6d 74 2c 20 69 tatement stmt, i
1d90: 6e 74 20 69 6e 64 65 78 29 3b 0a 20 20 20 20 69 nt index);. i
1da0: 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 61 63 74 nternal abstract
1db0: 20 62 6f 6f 6c 20 20 20 20 20 49 73 4e 75 6c 6c bool IsNull
1dc0: 28 53 51 4c 69 74 65 53 74 61 74 65 6d 65 6e 74 (SQLiteStatement
1dd0: 20 73 74 6d 74 2c 20 69 6e 74 20 69 6e 64 65 78 stmt, int index
1de0: 29 3b 0a 20 20 20 20 0a 20 20 20 20 2f 2f 2f 20 );. . ///
1df0: 3c 73 75 6d 6d 61 72 79 3e 0a 20 20 20 20 2f 2f <summary>. //
1e00: 2f 20 48 65 6c 70 65 72 20 66 75 6e 63 74 69 6f / Helper functio
1e10: 6e 20 74 6f 20 72 65 74 72 69 65 76 65 20 61 20 n to retrieve a
1e20: 63 6f 6c 75 6d 6e 20 6f 66 20 64 61 74 61 20 66 column of data f
1e30: 72 6f 6d 20 61 6e 20 61 63 74 69 76 65 20 73 74 rom an active st
1e40: 61 74 65 6d 65 6e 74 2e 0a 20 20 20 20 2f 2f 2f atement.. ///
1e50: 20 3c 2f 73 75 6d 6d 61 72 79 3e 0a 20 20 20 20 </summary>.
1e60: 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d /// <param name=
1e70: 22 73 74 6d 74 22 3e 54 68 65 20 73 74 61 74 65 "stmt">The state
1e80: 6d 65 6e 74 20 62 65 69 6e 67 20 73 74 65 70 28 ment being step(
1e90: 29 27 64 20 74 68 72 6f 75 67 68 3c 2f 70 61 72 )'d through</par
1ea0: 61 6d 3e 0a 20 20 20 20 2f 2f 2f 20 3c 70 61 72 am>. /// <par
1eb0: 61 6d 20 6e 61 6d 65 3d 22 69 6e 64 65 78 22 3e am name="index">
1ec0: 54 68 65 20 63 6f 6c 75 6d 6e 20 69 6e 64 65 78 The column index
1ed0: 20 74 6f 20 72 65 74 72 69 65 76 65 3c 2f 70 61 to retrieve</pa
1ee0: 72 61 6d 3e 0a 20 20 20 20 2f 2f 2f 20 3c 70 61 ram>. /// <pa
1ef0: 72 61 6d 20 6e 61 6d 65 3d 22 74 79 70 22 3e 54 ram name="typ">T
1f00: 68 65 20 74 79 70 65 20 6f 66 20 64 61 74 61 20 he type of data
1f10: 63 6f 6e 74 61 69 6e 65 64 20 69 6e 20 74 68 65 contained in the
1f20: 20 63 6f 6c 75 6d 6e 2e 20 20 49 66 20 55 6e 69 column. If Uni
1f30: 6e 69 74 69 61 6c 69 7a 65 64 2c 20 74 68 69 73 nitialized, this
1f40: 20 66 75 6e 63 74 69 6f 6e 20 77 69 6c 6c 20 72 function will r
1f50: 65 74 72 69 65 76 65 20 74 68 65 20 64 61 74 61 etrieve the data
1f60: 74 79 70 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e type information
1f70: 2e 3c 2f 70 61 72 61 6d 3e 0a 20 20 20 20 2f 2f .</param>. //
1f80: 2f 20 3c 72 65 74 75 72 6e 73 3e 52 65 74 75 72 / <returns>Retur
1f90: 6e 73 20 74 68 65 20 64 61 74 61 20 69 6e 20 74 ns the data in t
1fa0: 68 65 20 63 6f 6c 75 6d 6e 3c 2f 72 65 74 75 72 he column</retur
1fb0: 6e 73 3e 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c ns>. internal
1fc0: 20 76 69 72 74 75 61 6c 20 20 6f 62 6a 65 63 74 virtual object
1fd0: 20 20 20 47 65 74 56 61 6c 75 65 28 53 51 4c 69 GetValue(SQLi
1fe0: 74 65 53 74 61 74 65 6d 65 6e 74 20 73 74 6d 74 teStatement stmt
1ff0: 2c 20 69 6e 74 20 69 6e 64 65 78 2c 20 72 65 66 , int index, ref
2000: 20 53 51 4c 69 74 65 54 79 70 65 20 74 79 70 29 SQLiteType typ)
2010: 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 69 66 20 . {. if
2020: 28 74 79 70 2e 41 66 66 69 6e 69 74 79 20 3d 3d (typ.Affinity ==
2030: 20 30 29 20 74 79 70 20 3d 20 53 51 4c 69 74 65 0) typ = SQLite
2040: 43 6f 6e 76 65 72 74 2e 43 6f 6c 75 6d 6e 54 6f Convert.ColumnTo
2050: 54 79 70 65 28 73 74 6d 74 2c 20 69 6e 64 65 78 Type(stmt, index
2060: 29 3b 0a 20 20 20 20 20 20 69 66 20 28 49 73 4e );. if (IsN
2070: 75 6c 6c 28 73 74 6d 74 2c 20 69 6e 64 65 78 29 ull(stmt, index)
2080: 29 20 72 65 74 75 72 6e 20 44 42 4e 75 6c 6c 2e ) return DBNull.
2090: 56 61 6c 75 65 3b 0a 20 20 20 20 20 20 0a 20 20 Value;. .
20a0: 20 20 20 20 54 79 70 65 20 74 20 3d 20 53 51 4c Type t = SQL
20b0: 69 74 65 43 6f 6e 76 65 72 74 2e 53 51 4c 69 74 iteConvert.SQLit
20c0: 65 54 79 70 65 54 6f 54 79 70 65 28 74 79 70 29 eTypeToType(typ)
20d0: 3b 0a 0a 20 20 20 20 20 20 73 77 69 74 63 68 20 ;.. switch
20e0: 28 54 79 70 65 54 6f 41 66 66 69 6e 69 74 79 28 (TypeToAffinity(
20f0: 74 29 29 0a 20 20 20 20 20 20 7b 0a 20 20 20 20 t)). {.
2100: 20 20 20 20 63 61 73 65 20 54 79 70 65 41 66 66 case TypeAff
2110: 69 6e 69 74 79 2e 42 6c 6f 62 3a 0a 20 20 20 20 inity.Blob:.
2120: 20 20 20 20 20 20 69 6e 74 20 6e 20 3d 20 28 69 int n = (i
2130: 6e 74 29 47 65 74 42 79 74 65 73 28 73 74 6d 74 nt)GetBytes(stmt
2140: 2c 20 69 6e 64 65 78 2c 20 30 2c 20 6e 75 6c 6c , index, 0, null
2150: 2c 20 30 2c 20 30 29 3b 0a 20 20 20 20 20 20 20 , 0, 0);.
2160: 20 20 20 62 79 74 65 5b 5d 20 62 20 3d 20 6e 65 byte[] b = ne
2170: 77 20 62 79 74 65 5b 6e 5d 3b 0a 20 20 20 20 20 w byte[n];.
2180: 20 20 20 20 20 47 65 74 42 79 74 65 73 28 73 74 GetBytes(st
2190: 6d 74 2c 20 69 6e 64 65 78 2c 20 30 2c 20 62 2c mt, index, 0, b,
21a0: 20 30 2c 20 6e 29 3b 0a 20 20 20 20 20 20 20 20 0, n);.
21b0: 20 20 72 65 74 75 72 6e 20 62 3b 0a 20 20 20 20 return b;.
21c0: 20 20 20 20 63 61 73 65 20 54 79 70 65 41 66 66 case TypeAff
21d0: 69 6e 69 74 79 2e 44 61 74 65 54 69 6d 65 3a 0a inity.DateTime:.
21e0: 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e return
21f0: 20 47 65 74 44 61 74 65 54 69 6d 65 28 73 74 6d GetDateTime(stm
2200: 74 2c 20 69 6e 64 65 78 29 3b 0a 20 20 20 20 20 t, index);.
2210: 20 20 20 63 61 73 65 20 54 79 70 65 41 66 66 69 case TypeAffi
2220: 6e 69 74 79 2e 44 6f 75 62 6c 65 3a 0a 20 20 20 nity.Double:.
2230: 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 43 6f return Co
2240: 6e 76 65 72 74 2e 43 68 61 6e 67 65 54 79 70 65 nvert.ChangeType
2250: 28 47 65 74 44 6f 75 62 6c 65 28 73 74 6d 74 2c (GetDouble(stmt,
2260: 20 69 6e 64 65 78 29 2c 20 74 2c 20 6e 75 6c 6c index), t, null
2270: 29 3b 0a 20 20 20 20 20 20 20 20 63 61 73 65 20 );. case
2280: 54 79 70 65 41 66 66 69 6e 69 74 79 2e 49 6e 74 TypeAffinity.Int
2290: 36 34 3a 0a 20 20 20 20 20 20 20 20 20 20 72 65 64:. re
22a0: 74 75 72 6e 20 43 6f 6e 76 65 72 74 2e 43 68 61 turn Convert.Cha
22b0: 6e 67 65 54 79 70 65 28 47 65 74 49 6e 74 36 34 ngeType(GetInt64
22c0: 28 73 74 6d 74 2c 20 69 6e 64 65 78 29 2c 20 74 (stmt, index), t
22d0: 2c 20 6e 75 6c 6c 29 3b 0a 20 20 20 20 20 20 20 , null);.
22e0: 20 64 65 66 61 75 6c 74 3a 0a 20 20 20 20 20 20 default:.
22f0: 20 20 20 20 72 65 74 75 72 6e 20 47 65 74 54 65 return GetTe
2300: 78 74 28 73 74 6d 74 2c 20 69 6e 64 65 78 29 3b xt(stmt, index);
2310: 0a 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 0a . }. }..
2320: 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 internal abs
2330: 74 72 61 63 74 20 69 6e 74 20 20 43 72 65 61 74 tract int Creat
2340: 65 43 6f 6c 6c 61 74 69 6f 6e 28 73 74 72 69 6e eCollation(strin
2350: 67 20 73 74 72 43 6f 6c 6c 61 74 69 6f 6e 2c 20 g strCollation,
2360: 53 51 4c 69 74 65 43 6f 6c 6c 61 74 69 6f 6e 20 SQLiteCollation
2370: 66 75 6e 63 29 3b 0a 20 20 20 20 69 6e 74 65 72 func);. inter
2380: 6e 61 6c 20 61 62 73 74 72 61 63 74 20 69 6e 74 nal abstract int
2390: 20 20 43 72 65 61 74 65 46 75 6e 63 74 69 6f 6e CreateFunction
23a0: 28 73 74 72 69 6e 67 20 73 74 72 46 75 6e 63 74 (string strFunct
23b0: 69 6f 6e 2c 20 69 6e 74 20 6e 41 72 67 73 2c 20 ion, int nArgs,
23c0: 53 51 4c 69 74 65 43 61 6c 6c 62 61 63 6b 20 66 SQLiteCallback f
23d0: 75 6e 63 2c 20 53 51 4c 69 74 65 43 61 6c 6c 62 unc, SQLiteCallb
23e0: 61 63 6b 20 66 75 6e 63 73 74 65 70 2c 20 53 51 ack funcstep, SQ
23f0: 4c 69 74 65 43 61 6c 6c 62 61 63 6b 20 66 75 6e LiteCallback fun
2400: 63 66 69 6e 61 6c 29 3b 0a 20 20 20 20 69 6e 74 cfinal);. int
2410: 65 72 6e 61 6c 20 61 62 73 74 72 61 63 74 20 76 ernal abstract v
2420: 6f 69 64 20 46 72 65 65 46 75 6e 63 74 69 6f 6e oid FreeFunction
2430: 28 69 6e 74 20 6e 43 6f 6f 6b 69 65 29 3b 0a 0a (int nCookie);..
2440: 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 internal abs
2450: 74 72 61 63 74 20 69 6e 74 20 41 67 67 72 65 67 tract int Aggreg
2460: 61 74 65 43 6f 75 6e 74 28 69 6e 74 20 63 6f 6e ateCount(int con
2470: 74 65 78 74 29 3b 0a 20 20 20 20 69 6e 74 65 72 text);. inter
2480: 6e 61 6c 20 61 62 73 74 72 61 63 74 20 69 6e 74 nal abstract int
2490: 20 41 67 67 72 65 67 61 74 65 43 6f 6e 74 65 78 AggregateContex
24a0: 74 28 69 6e 74 20 63 6f 6e 74 65 78 74 29 3b 0a t(int context);.
24b0: 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 . internal ab
24c0: 73 74 72 61 63 74 20 6c 6f 6e 67 20 20 20 47 65 stract long Ge
24d0: 74 50 61 72 61 6d 56 61 6c 75 65 42 79 74 65 73 tParamValueBytes
24e0: 28 69 6e 74 20 70 74 72 2c 20 69 6e 74 20 6e 44 (int ptr, int nD
24f0: 61 74 61 4f 66 66 73 65 74 2c 20 62 79 74 65 5b ataOffset, byte[
2500: 5d 20 62 44 65 73 74 2c 20 69 6e 74 20 6e 53 74 ] bDest, int nSt
2510: 61 72 74 2c 20 69 6e 74 20 6e 4c 65 6e 67 74 68 art, int nLength
2520: 29 3b 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 );. internal
2530: 61 62 73 74 72 61 63 74 20 64 6f 75 62 6c 65 20 abstract double
2540: 47 65 74 50 61 72 61 6d 56 61 6c 75 65 44 6f 75 GetParamValueDou
2550: 62 6c 65 28 69 6e 74 20 70 74 72 29 3b 0a 20 20 ble(int ptr);.
2560: 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 internal abstr
2570: 61 63 74 20 69 6e 74 20 20 20 20 47 65 74 50 61 act int GetPa
2580: 72 61 6d 56 61 6c 75 65 49 6e 74 33 32 28 69 6e ramValueInt32(in
2590: 74 20 70 74 72 29 3b 0a 20 20 20 20 69 6e 74 65 t ptr);. inte
25a0: 72 6e 61 6c 20 61 62 73 74 72 61 63 74 20 49 6e rnal abstract In
25b0: 74 36 34 20 20 47 65 74 50 61 72 61 6d 56 61 6c t64 GetParamVal
25c0: 75 65 49 6e 74 36 34 28 69 6e 74 20 70 74 72 29 ueInt64(int ptr)
25d0: 3b 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 61 ;. internal a
25e0: 62 73 74 72 61 63 74 20 73 74 72 69 6e 67 20 47 bstract string G
25f0: 65 74 50 61 72 61 6d 56 61 6c 75 65 54 65 78 74 etParamValueText
2600: 28 69 6e 74 20 70 74 72 29 3b 0a 20 20 20 20 69 (int ptr);. i
2610: 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 61 63 74 nternal abstract
2620: 20 54 79 70 65 41 66 66 69 6e 69 74 79 20 47 65 TypeAffinity Ge
2630: 74 50 61 72 61 6d 56 61 6c 75 65 54 79 70 65 28 tParamValueType(
2640: 69 6e 74 20 70 74 72 29 3b 0a 0a 20 20 20 20 69 int ptr);.. i
2650: 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 61 63 74 nternal abstract
2660: 20 76 6f 69 64 20 52 65 74 75 72 6e 42 6c 6f 62 void ReturnBlob
2670: 28 69 6e 74 20 63 6f 6e 74 65 78 74 2c 20 62 79 (int context, by
2680: 74 65 5b 5d 20 76 61 6c 75 65 29 3b 0a 20 20 20 te[] value);.
2690: 20 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 61 internal abstra
26a0: 63 74 20 76 6f 69 64 20 52 65 74 75 72 6e 44 6f ct void ReturnDo
26b0: 75 62 6c 65 28 69 6e 74 20 63 6f 6e 74 65 78 74 uble(int context
26c0: 2c 20 64 6f 75 62 6c 65 20 76 61 6c 75 65 29 3b , double value);
26d0: 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 61 62 . internal ab
26e0: 73 74 72 61 63 74 20 76 6f 69 64 20 52 65 74 75 stract void Retu
26f0: 72 6e 45 72 72 6f 72 28 69 6e 74 20 63 6f 6e 74 rnError(int cont
2700: 65 78 74 2c 20 73 74 72 69 6e 67 20 76 61 6c 75 ext, string valu
2710: 65 29 3b 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c e);. internal
2720: 20 61 62 73 74 72 61 63 74 20 76 6f 69 64 20 52 abstract void R
2730: 65 74 75 72 6e 49 6e 74 33 32 28 69 6e 74 20 63 eturnInt32(int c
2740: 6f 6e 74 65 78 74 2c 20 49 6e 74 33 32 20 76 61 ontext, Int32 va
2750: 6c 75 65 29 3b 0a 20 20 20 20 69 6e 74 65 72 6e lue);. intern
2760: 61 6c 20 61 62 73 74 72 61 63 74 20 76 6f 69 64 al abstract void
2770: 20 52 65 74 75 72 6e 49 6e 74 36 34 28 69 6e 74 ReturnInt64(int
2780: 20 63 6f 6e 74 65 78 74 2c 20 49 6e 74 36 34 20 context, Int64
2790: 76 61 6c 75 65 29 3b 0a 20 20 20 20 69 6e 74 65 value);. inte
27a0: 72 6e 61 6c 20 61 62 73 74 72 61 63 74 20 76 6f rnal abstract vo
27b0: 69 64 20 52 65 74 75 72 6e 4e 75 6c 6c 28 69 6e id ReturnNull(in
27c0: 74 20 63 6f 6e 74 65 78 74 29 3b 0a 20 20 20 20 t context);.
27d0: 69 6e 74 65 72 6e 61 6c 20 61 62 73 74 72 61 63 internal abstrac
27e0: 74 20 76 6f 69 64 20 52 65 74 75 72 6e 54 65 78 t void ReturnTex
27f0: 74 28 69 6e 74 20 63 6f 6e 74 65 78 74 2c 20 73 t(int context, s
2800: 74 72 69 6e 67 20 76 61 6c 75 65 29 3b 0a 0a 20 tring value);..
2810: 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 69 72 protected vir
2820: 74 75 61 6c 20 76 6f 69 64 20 44 69 73 70 6f 73 tual void Dispos
2830: 65 28 62 6f 6f 6c 20 62 44 69 73 70 6f 73 69 6e e(bool bDisposin
2840: 67 29 0a 20 20 20 20 7b 0a 20 20 20 20 7d 0a 0a g). {. }..
2850: 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 public void
2860: 44 69 73 70 6f 73 65 28 29 0a 20 20 20 20 7b 0a Dispose(). {.
2870: 20 20 20 20 20 20 44 69 73 70 6f 73 65 28 74 72 Dispose(tr
2880: 75 65 29 3b 0a 20 20 20 20 20 20 47 43 2e 53 75 ue);. GC.Su
2890: 70 70 72 65 73 73 46 69 6e 61 6c 69 7a 65 28 74 ppressFinalize(t
28a0: 68 69 73 29 3b 0a 20 20 20 20 7d 0a 20 20 7d 0a his);. }. }.
28b0: 7d 0a }.