System.Data.SQLite

Check-in [f4aec657e0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:VS2005 Beta 2 updates
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: f4aec657e0660a36b9bea66c6ba76c0ecf5373dd
User & Date: rmsimpson 2005-05-24 22:12:44.000
Context
2005-05-24
22:32
1.09 check-in: f1e8146eae user: rmsimpson tags: sourceforge
22:12
VS2005 Beta 2 updates check-in: f4aec657e0 user: rmsimpson tags: sourceforge
22:10
SQLite 3.21 code merge check-in: caea6168de user: rmsimpson tags: sourceforge
Changes
Unified Diff Ignore Whitespace Patch
Changes to SQLite.Interop/SQLite.Interop.vcproj.
1
2
3
4
5
6
7
8

9
10
11
12
13
14
15
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="8.00"
	Name="SQLite.Interop"
	ProjectGUID="{10B51CE8-A838-44DE-BD82-B658F0296F80}"
	RootNamespace="SQLite.Interop"
	Keyword="Win32Proj"

	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
	</Platforms>
	<ToolFiles>








>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="8.00"
	Name="SQLite.Interop"
	ProjectGUID="{10B51CE8-A838-44DE-BD82-B658F0296F80}"
	RootNamespace="SQLite.Interop"
	Keyword="Win32Proj"
	SignManifests="true"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
	</Platforms>
	<ToolFiles>
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
			<Tool
				Name="VCCLCompilerTool"
				Optimization="3"
				FavorSizeOrSpeed="1"
				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE"
				StringPooling="true"
				ExceptionHandling="0"
				RuntimeLibrary="2"
				BufferSecurityCheck="false"
				EnableFunctionLevelLinking="true"
				UsePrecompiledHeader="0"
				WarningLevel="1"
				DebugInformationFormat="0"
			/>
			<Tool







|







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
			<Tool
				Name="VCCLCompilerTool"
				Optimization="3"
				FavorSizeOrSpeed="1"
				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE"
				StringPooling="true"
				ExceptionHandling="0"
				RuntimeLibrary="0"
				BufferSecurityCheck="false"
				EnableFunctionLevelLinking="true"
				UsePrecompiledHeader="0"
				WarningLevel="1"
				DebugInformationFormat="0"
			/>
			<Tool
Changes to System.Data.SQLite/SQLiteCommandBuilder.cs.
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
    /// <param name="parameterOrdinal">The index of the parameter to provide a placeholder for</param>
    /// <returns>Returns a "?" character, used for all placeholders.</returns>
    protected override string GetParameterPlaceholder(int parameterOrdinal)
    {
      return "?";
    }

#if !PLATFORM_COMPACTFRAMEWORK
    /// <summary>
    /// Obsolete
    /// </summary>
#if !BETA1
    [Obsolete]
#endif
    protected override DbProviderFactory ProviderFactory
    {
      get 
      {
        return new SQLiteFactory();
      }
    }
#endif

    /// <summary>
    /// Not implemented.
    /// </summary>
    /// <param name="adapter">A data adapter to receive events on.</param>
    protected override void SetRowUpdatingHandler(DbDataAdapter adapter)
    {
    }







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







72
73
74
75
76
77
78
















79
80
81
82
83
84
85
    /// <param name="parameterOrdinal">The index of the parameter to provide a placeholder for</param>
    /// <returns>Returns a "?" character, used for all placeholders.</returns>
    protected override string GetParameterPlaceholder(int parameterOrdinal)
    {
      return "?";
    }

















    /// <summary>
    /// Not implemented.
    /// </summary>
    /// <param name="adapter">A data adapter to receive events on.</param>
    protected override void SetRowUpdatingHandler(DbDataAdapter adapter)
    {
    }
Changes to System.Data.SQLite/SQLiteConnection.cs.
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
    /// </summary>
    internal SQLiteBase          _sql;
    /// <summary>
    /// Commands associated with this connection
    /// </summary>
    internal List<SQLiteCommand> _commandList;

#if !PLATFORM_COMPACTFRAMEWORK && !BETA1
    /// <event/>
    /// <summary>
    /// This event is raised whenever the database is opened or closed.
    /// </summary>
    public override event StateChangeEventHandler StateChange;
#endif

    ///<overloads>
    /// Constructs a new SQLiteConnection object
    /// </overloads>
    /// <summary>
    /// Default constructor
    /// </summary>







<





<







106
107
108
109
110
111
112

113
114
115
116
117

118
119
120
121
122
123
124
    /// </summary>
    internal SQLiteBase          _sql;
    /// <summary>
    /// Commands associated with this connection
    /// </summary>
    internal List<SQLiteCommand> _commandList;


    /// <event/>
    /// <summary>
    /// This event is raised whenever the database is opened or closed.
    /// </summary>
    public override event StateChangeEventHandler StateChange;


    ///<overloads>
    /// Constructs a new SQLiteConnection object
    /// </overloads>
    /// <summary>
    /// Default constructor
    /// </summary>
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
              _sql.Execute(String.Format("ATTACH DATABASE '{0}' AS [{1}]", row[1], row[0]));
            }
          }
        }
      }
    }

#if PLATFORM_COMPACTFRAMEWORK && !BETA1
    /// <summary>
    /// Obsolete
    /// </summary>
    public override int ConnectionTimeout
    {
      get
      {







|







163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
              _sql.Execute(String.Format("ATTACH DATABASE '{0}' AS [{1}]", row[1], row[0]));
            }
          }
        }
      }
    }

#if PLATFORM_COMPACTFRAMEWORK
    /// <summary>
    /// Obsolete
    /// </summary>
    public override int ConnectionTimeout
    {
      get
      {
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
    /// </summary>
    /// <param name="newState">The new state.  If it is different from the previous state, an event is raised.</param>
    internal void OnStateChange(ConnectionState newState)
    {
      ConnectionState oldState = _connectionState;
      _connectionState = newState;

#if !PLATFORM_COMPACTFRAMEWORK && !BETA1
      if (StateChange != null && oldState != newState)
      {
        StateChangeEventArgs e = new StateChangeEventArgs(oldState, newState);
        StateChange(this, e);
      }
#endif
    }

    /// <summary>
    /// Creates a new SQLiteTransaction if one isn't already active on the connection.
    /// </summary>
    /// <param name="isolationLevel">SQLite doesn't support varying isolation levels, so this parameter is ignored.</param>
    /// <returns>Returns a SQLiteTransaction object.</returns>







<





<







217
218
219
220
221
222
223

224
225
226
227
228

229
230
231
232
233
234
235
    /// </summary>
    /// <param name="newState">The new state.  If it is different from the previous state, an event is raised.</param>
    internal void OnStateChange(ConnectionState newState)
    {
      ConnectionState oldState = _connectionState;
      _connectionState = newState;


      if (StateChange != null && oldState != newState)
      {
        StateChangeEventArgs e = new StateChangeEventArgs(oldState, newState);
        StateChange(this, e);
      }

    }

    /// <summary>
    /// Creates a new SQLiteTransaction if one isn't already active on the connection.
    /// </summary>
    /// <param name="isolationLevel">SQLite doesn't support varying isolation levels, so this parameter is ignored.</param>
    /// <returns>Returns a SQLiteTransaction object.</returns>
Changes to System.Data.SQLite/SQLiteConvert.cs.
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215

216
217

218
219
220
221

222
223
224

225
226
227
228


229

230
231
232
233
234

235
236
237
238
239
240
241
        case DateTimeFormat.Ticks:
          return new DateTime(Convert.ToInt64(strSrc));
        default:
          return DateTime.ParseExact(strSrc, _datetimeFormats, System.Globalization.DateTimeFormatInfo.InvariantInfo, System.Globalization.DateTimeStyles.None);
      }
    }

    /// <summary>
    /// Attempt to convert the specified string to a datetime value.
    /// </summary>
    /// <param name="strSrc">The string to parse into a datetime</param>
    /// <param name="result">If successful, a valid datetime structure</param>
    /// <returns>Returns true if the string was a valid ISO8601 datetime, false otherwise.</returns>
    public bool TryToDateTime(string strSrc, out DateTime result)
    {

      switch (_datetimeFormat)
      {

        case DateTimeFormat.ISO8601:
          return DateTime.TryParseExact(strSrc, _datetimeFormats, System.Globalization.DateTimeFormatInfo.InvariantInfo, System.Globalization.DateTimeStyles.None, out result);
        case DateTimeFormat.Ticks:
          {

            long n;
            if (long.TryParse(strSrc, out n) == true)
            {

              result = new DateTime(n);
              return true;
            }
          }


          break;

      }

      result = DateTime.Now;
      return false;
    }


    /// <summary>
    /// Converts a DateTime to a string value, using the current DateTimeFormat specified for the connection when it was opened.
    /// </summary>
    /// <param name="dtSrc">The DateTime value to convert</param>
    /// <returns>Either a string consisting of the tick count for DateTimeFormat.Ticks, or a date/time in ISO8601 format.</returns>
    public string ToString(DateTime dtSrc)







|
|
|
|
|
|
|
<
>
|
<
>
|
|
|
<
>
|
|
<
>
|
|
<
<
>
>
|
>
|
<
|
|
<
>







201
202
203
204
205
206
207
208
209
210
211
212
213
214

215
216

217
218
219
220

221
222
223

224
225
226


227
228
229
230
231

232
233

234
235
236
237
238
239
240
241
        case DateTimeFormat.Ticks:
          return new DateTime(Convert.ToInt64(strSrc));
        default:
          return DateTime.ParseExact(strSrc, _datetimeFormats, System.Globalization.DateTimeFormatInfo.InvariantInfo, System.Globalization.DateTimeStyles.None);
      }
    }

    ///// <summary>
    ///// Attempt to convert the specified string to a datetime value.
    ///// </summary>
    ///// <param name="strSrc">The string to parse into a datetime</param>
    ///// <param name="result">If successful, a valid datetime structure</param>
    ///// <returns>Returns true if the string was a valid ISO8601 datetime, false otherwise.</returns>
    //public bool TryToDateTime(string strSrc, out DateTime result)

    //{
    //  switch (_datetimeFormat)

    //  {
    //    case DateTimeFormat.ISO8601:
    //      return DateTime.TryParseExact(strSrc, _datetimeFormats, System.Globalization.DateTimeFormatInfo.InvariantInfo, System.Globalization.DateTimeStyles.None, out result);
    //    case DateTimeFormat.Ticks:

    //      {
    //        long n;
    //        if (long.TryParse(strSrc, out n) == true)

    //        {
    //          result = new DateTime(n);
    //          return true;


    //        }
    //      }
    //      break;
    //  }


    //  result = DateTime.Now;
    //  return false;

    //}

    /// <summary>
    /// Converts a DateTime to a string value, using the current DateTimeFormat specified for the connection when it was opened.
    /// </summary>
    /// <param name="dtSrc">The DateTime value to convert</param>
    /// <returns>Either a string consisting of the tick count for DateTimeFormat.Ticks, or a date/time in ISO8601 format.</returns>
    public string ToString(DateTime dtSrc)
Changes to System.Data.SQLite/SQLiteFactory.cs.
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  public sealed class SQLiteFactory : DbProviderFactory
  {
    /// <summary>
    /// Static instance member which returns an instanced SQLiteFactory class.
    /// </summary>
    public static readonly SQLiteFactory Instance = new SQLiteFactory();

    /// <summary>
    /// Returns the types of classes this factory supports
    /// </summary>
    [Obsolete]
    public override DbProviderSupportedClasses SupportedClasses
    {
      get
      {
        return (DbProviderSupportedClasses)0x3F;
      }
    }

    /// <summary>
    /// Returns a new SQLiteCommand object.
    /// </summary>
    /// <returns>A SQLiteCommand object.</returns>
    public override DbCommand CreateCommand()
    {
      return new SQLiteCommand();







<
<
<
<
<
<
<
<
<
<
<
<







17
18
19
20
21
22
23












24
25
26
27
28
29
30
  public sealed class SQLiteFactory : DbProviderFactory
  {
    /// <summary>
    /// Static instance member which returns an instanced SQLiteFactory class.
    /// </summary>
    public static readonly SQLiteFactory Instance = new SQLiteFactory();













    /// <summary>
    /// Returns a new SQLiteCommand object.
    /// </summary>
    /// <returns>A SQLiteCommand object.</returns>
    public override DbCommand CreateCommand()
    {
      return new SQLiteCommand();
Changes to System.Data.SQLite/SQLiteFunction.cs.
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
    /// <summary>
    /// Used internally to keep track of memory allocated for aggregate functions
    /// </summary>
    private int                     _interopCookie;
    /// <summary>
    /// Internal array used to keep track of aggregate function context data
    /// </summary>
#if !PLATFORM_COMPACTFRAMEWORK && !BETA1
    private SortedList<int, object> _contextDataList;
#else
    private SortedList _contextDataList;
#endif

    /// <summary>
    /// Holds a reference to the callback function for user functions
    /// </summary>
    private SQLiteCallback  _InvokeFunc;
    /// <summary>
    /// Holds a reference to the callbakc function for stepping in an aggregate function







<

<
<
<







77
78
79
80
81
82
83

84



85
86
87
88
89
90
91
    /// <summary>
    /// Used internally to keep track of memory allocated for aggregate functions
    /// </summary>
    private int                     _interopCookie;
    /// <summary>
    /// Internal array used to keep track of aggregate function context data
    /// </summary>

    private SortedList<int, object> _contextDataList;




    /// <summary>
    /// Holds a reference to the callback function for user functions
    /// </summary>
    private SQLiteCallback  _InvokeFunc;
    /// <summary>
    /// Holds a reference to the callbakc function for stepping in an aggregate function
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
    private static List<SQLiteFunctionAttribute> _registeredFunctions = new List<SQLiteFunctionAttribute>();

    /// <summary>
    /// Internal constructor, initializes the function's internal variables.
    /// </summary>
    protected SQLiteFunction()
    {
#if !PLATFORM_COMPACTFRAMEWORK && !BETA1
      _contextDataList = new SortedList<int, object>();
#else
      _contextDataList = new SortedList();
#endif
      _InvokeFunc = null;
      _StepFunc = null;
      _FinalFunc = null;
      _CompareFunc = null;
    }

    /// <summary>







<

<
<
<







106
107
108
109
110
111
112

113



114
115
116
117
118
119
120
    private static List<SQLiteFunctionAttribute> _registeredFunctions = new List<SQLiteFunctionAttribute>();

    /// <summary>
    /// Internal constructor, initializes the function's internal variables.
    /// </summary>
    protected SQLiteFunction()
    {

      _contextDataList = new SortedList<int, object>();



      _InvokeFunc = null;
      _StepFunc = null;
      _FinalFunc = null;
      _CompareFunc = null;
    }

    /// <summary>
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
    /// </summary>
    public void Dispose()
    {
      Dispose(true);

      IDisposable disp;

#if !PLATFORM_COMPACTFRAMEWORK && !BETA1
      foreach (KeyValuePair<int, object> kv in _contextDataList)
#else
      foreach (DictionaryEntry kv in _contextDataList)
#endif
      {
        disp = kv.Value as IDisposable;
        if (disp != null)
          disp.Dispose();
      }
      _contextDataList.Clear();








<

<
<
<







377
378
379
380
381
382
383

384



385
386
387
388
389
390
391
    /// </summary>
    public void Dispose()
    {
      Dispose(true);

      IDisposable disp;


      foreach (KeyValuePair<int, object> kv in _contextDataList)



      {
        disp = kv.Value as IDisposable;
        if (disp != null)
          disp.Dispose();
      }
      _contextDataList.Clear();

Changes to System.Data.SQLite/SQLiteParameter.cs.
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
        return true;
      }
      set 
      {
      }
    }

    /// <summary>
    /// Not implemented
    /// </summary>
    /// <param name="destination"></param>
    [Obsolete]
    public override void CopyTo(DbParameter destination)
    {
      throw new NotImplementedException();
    }

    /// <summary>
    /// Returns the datatype of the parameter
    /// </summary>
    public override DbType DbType
    {
      get
      {







<
<
<
<
<
<
<
<
<
<







218
219
220
221
222
223
224










225
226
227
228
229
230
231
        return true;
      }
      set 
      {
      }
    }











    /// <summary>
    /// Returns the datatype of the parameter
    /// </summary>
    public override DbType DbType
    {
      get
      {
Changes to System.Data.SQLite/SQLiteParameterCollection.cs.
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
    public override void AddRange(Array values)
    {
      int x = values.Length;
      for (int n = 0; n < x; n++)
        Add((SQLiteParameter)(values.GetValue(n)));
    }

    /// <summary>
    /// Obsolete
    /// </summary>
    /// <param name="parameterName"></param>
    /// <returns></returns>
    [Obsolete]
    protected override int CheckName(string parameterName)
    {
      throw new NotImplementedException();
    }

    /// <summary>
    /// Clears the array and resets the collection
    /// </summary>
    public override void Clear()
    {
      _unboundFlag = true;
      _parameterList.Clear();







<
<
<
<
<
<
<
<
<
<
<







180
181
182
183
184
185
186











187
188
189
190
191
192
193
    public override void AddRange(Array values)
    {
      int x = values.Length;
      for (int n = 0; n < x; n++)
        Add((SQLiteParameter)(values.GetValue(n)));
    }












    /// <summary>
    /// Clears the array and resets the collection
    /// </summary>
    public override void Clear()
    {
      _unboundFlag = true;
      _parameterList.Clear();
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
    /// Returns a count of parameters in the collection
    /// </summary>
    public override int Count
    {
      get { return _parameterList.Count; }
    }

#if !PLATFORM_COMPACTFRAMEWORK && !BETA1
    /// <summary>
    /// Retrieve a parameter by name from the collection
    /// </summary>
    /// <param name="parameterName">The name of the parameter to fetch</param>
    /// <returns>A DbParameter object</returns>
    protected override DbParameter GetParameter(string parameterName)
    {
      return GetParameter(IndexOf(parameterName));
    }
#endif

    /// <summary>
    /// Retrieves a parameter by its index in the collection
    /// </summary>
    /// <param name="index">The index of the parameter to retrieve</param>
    /// <returns>A DbParameter object</returns>
    protected override DbParameter GetParameter(int index)







<









<







227
228
229
230
231
232
233

234
235
236
237
238
239
240
241
242

243
244
245
246
247
248
249
    /// Returns a count of parameters in the collection
    /// </summary>
    public override int Count
    {
      get { return _parameterList.Count; }
    }


    /// <summary>
    /// Retrieve a parameter by name from the collection
    /// </summary>
    /// <param name="parameterName">The name of the parameter to fetch</param>
    /// <returns>A DbParameter object</returns>
    protected override DbParameter GetParameter(string parameterName)
    {
      return GetParameter(IndexOf(parameterName));
    }


    /// <summary>
    /// Retrieves a parameter by its index in the collection
    /// </summary>
    /// <param name="index">The index of the parameter to retrieve</param>
    /// <returns>A DbParameter object</returns>
    protected override DbParameter GetParameter(int index)
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
    /// <param name="index">The zero-based parameter index to remove</param>
    public override void RemoveAt(int index)
    {
      _unboundFlag = true;
      _parameterList.RemoveAt(index);
    }

#if !PLATFORM_COMPACTFRAMEWORK && !BETA1
    /// <summary>
    /// Re-assign the named parameter to a new parameter object
    /// </summary>
    /// <param name="parameterName">The name of the parameter to replace</param>
    /// <param name="value">The new parameter</param>
    protected override void SetParameter(string parameterName, DbParameter value)
    {
      SetParameter(IndexOf(parameterName), value);
    }
#endif

    /// <summary>
    /// Re-assign a parameter at the specified index
    /// </summary>
    /// <param name="index">The zero-based index of the parameter to replace</param>
    /// <param name="value">The new parameter</param>
    protected override void SetParameter(int index, DbParameter value)







<









<







312
313
314
315
316
317
318

319
320
321
322
323
324
325
326
327

328
329
330
331
332
333
334
    /// <param name="index">The zero-based parameter index to remove</param>
    public override void RemoveAt(int index)
    {
      _unboundFlag = true;
      _parameterList.RemoveAt(index);
    }


    /// <summary>
    /// Re-assign the named parameter to a new parameter object
    /// </summary>
    /// <param name="parameterName">The name of the parameter to replace</param>
    /// <param name="value">The new parameter</param>
    protected override void SetParameter(string parameterName, DbParameter value)
    {
      SetParameter(IndexOf(parameterName), value);
    }


    /// <summary>
    /// Re-assign a parameter at the specified index
    /// </summary>
    /// <param name="index">The zero-based index of the parameter to replace</param>
    /// <param name="value">The new parameter</param>
    protected override void SetParameter(int index, DbParameter value)
Changes to System.Data.SQLite/System.Data.SQLite.csproj.
1
2
3
4
5
6
7
8
9
10
11
12
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.41202</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{AC139951-261A-4463-B6FA-AEBC25283A66}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>System.Data.SQLite</RootNamespace>
    <AssemblyName>System.Data.SQLite</AssemblyName>
    <WarningLevel>4</WarningLevel>
    <SignAssembly>true</SignAssembly>




|







1
2
3
4
5
6
7
8
9
10
11
12
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50215</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{AC139951-261A-4463-B6FA-AEBC25283A66}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>System.Data.SQLite</RootNamespace>
    <AssemblyName>System.Data.SQLite</AssemblyName>
    <WarningLevel>4</WarningLevel>
    <SignAssembly>true</SignAssembly>
Changes to System.Data.SQLite/UnsafeNativeMethods.cs.
1
2
3
4
5
6
7
8
9
10
11
12
13

14

15
16
17
18
19
20
21
/********************************************************
 * ADO.NET 2.0 Data Provider for SQLite Version 3.X
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

namespace System.Data.SQLite
{
  using System;
  using System.Security;
  using System.Runtime.InteropServices;


  [SuppressUnmanagedCodeSecurity]

  internal class UnsafeNativeMethods
  {
    private const string SQLITE_DLL = "SQLite.Interop.DLL";

    [DllImport(SQLITE_DLL)]
    internal static extern IntPtr sqlite3_libversion_interop(out int len);














>

>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/********************************************************
 * ADO.NET 2.0 Data Provider for SQLite Version 3.X
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

namespace System.Data.SQLite
{
  using System;
  using System.Security;
  using System.Runtime.InteropServices;

#if !PLATFORM_COMPACTFRAMEWORK
  [SuppressUnmanagedCodeSecurity]
#endif
  internal class UnsafeNativeMethods
  {
    private const string SQLITE_DLL = "SQLite.Interop.DLL";

    [DllImport(SQLITE_DLL)]
    internal static extern IntPtr sqlite3_libversion_interop(out int len);

Changes to bin/SQLite.Interop.dll.

cannot compute difference between binary files

Changes to bin/System.Data.SQLite.dll.

cannot compute difference between binary files

Changes to bin/test.exe.

cannot compute difference between binary files

Changes to readme.htm.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title></title>
	</head>
	<body>
    ADO.NET 2.0 SQLite Data Provider<br />
    Version 1.0.8 - Mar 24, 2005<br />
    Interop using SQLite 3.20<br />
    Written by Robert Simpson (<a href="mailto:robert@blackcastlesoft.com">robert@blackcastlesoft.com</a>)<br />
    Released to the public domain, use at your own risk!<br />
    <br />
    This provider was written and verified using the Visual Studio 2005 November, December
    and February 2005 CTP's.&nbsp; The binaries included in the distribution were compiled
    with the 2.0.50110 version of the .NET framework (VS2005 February 2005 CTP).<br />
    <br />
    The latest version can be downloaded <a href="http://sourceforge.net/projects/sqlite-dotnet2">here</a>
    <br />
    <br />

    <b></b>
    <h2>












|
<
<







1
2
3
4
5
6
7
8
9
10
11
12
13


14
15
16
17
18
19
20
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title></title>
	</head>
	<body>
    ADO.NET 2.0 SQLite Data Provider<br />
    Version 1.0.8 - Mar 24, 2005<br />
    Interop using SQLite 3.20<br />
    Written by Robert Simpson (<a href="mailto:robert@blackcastlesoft.com">robert@blackcastlesoft.com</a>)<br />
    Released to the public domain, use at your own risk!<br />
    <br />
    This provider was written and verified using the Visual Studio 2005 Beta 2 release.<br />


    <br />
    The latest version can be downloaded <a href="http://sourceforge.net/projects/sqlite-dotnet2">here</a>
    <br />
    <br />

    <b></b>
    <h2>
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
      &lt;add name="SQLite Data Provider" invariant="System.Data.SQLite" support="3F" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /&gt;
    &lt;/DbProviderFactories&gt;
  &lt;/system.data&gt;
&lt;/configuration&gt;
</pre>
    <br />
    <h3>
      Compiling for Beta 1:</h3>
    The <strong>System.Data.SQLite</strong> project was compiled using the November/December/February
    CTP's of Visual Studio 2005, but it can be compiled with some trivial effort on
    the previous Beta 1 edition of VS2005.&nbsp; Just right-click the <strong>System.Data.SQLite</strong>
    project, select <strong>Properties</strong>, go to the <strong>Build</strong> tab,
    and add <strong>BETA1</strong> to the conditional compilation symbols.<br />
    <br />
    <h3>
      Compiling for the Compact Framework</h3>
    <p>
      The SQLite.Interop.DLL does not (yet) support a build that includes Windows CE processor
      architectures.&nbsp; I am aware of the CE port of SQLite and will be investigating
      their code to see how best to proceed in that regard.&nbsp; I am also waiting for
      the newer version of SQLite to become available which will offer select metadata
      information and will cause a major redesign of this library to support it.<br />







<
<
<
<
<
<
<
<







54
55
56
57
58
59
60








61
62
63
64
65
66
67
      &lt;add name="SQLite Data Provider" invariant="System.Data.SQLite" support="3F" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /&gt;
    &lt;/DbProviderFactories&gt;
  &lt;/system.data&gt;
&lt;/configuration&gt;
</pre>
    <br />
    <h3>








      Compiling for the Compact Framework</h3>
    <p>
      The SQLite.Interop.DLL does not (yet) support a build that includes Windows CE processor
      architectures.&nbsp; I am aware of the CE port of SQLite and will be investigating
      their code to see how best to proceed in that regard.&nbsp; I am also waiting for
      the newer version of SQLite to become available which will offer select metadata
      information and will cause a major redesign of this library to support it.<br />
93
94
95
96
97
98
99
100




101
102
103
104
105
106
107
108
109
      <li>Scroll down the <b>select.c</b> file to around line <b>748</b>.&nbsp; Change the name of the function <b>static void generateColumnNames </b>to
    <b>static void _generateColumnNames</b> (<i>note the underscore in front of the name</i>).</li>
      <li>Compile it.</li>
    </ol>
      <b>
      </b>
    <h2>
      <b>Version History</b></h2>




    <b>1.08 Refresh - Mar 24, 2005<br />
    </b>
    <ul>
      <li>Code merge with the latest 3.20 version of SQLite.</li>
      <li>Recompiled the help file to fix a build error in it.</li>
    </ul>
    <b>1.08 - Mar 11, 2005<br />
    </b>
    <ul>







|
>
>
>
>
|
<







83
84
85
86
87
88
89
90
91
92
93
94
95

96
97
98
99
100
101
102
      <li>Scroll down the <b>select.c</b> file to around line <b>748</b>.&nbsp; Change the name of the function <b>static void generateColumnNames </b>to
    <b>static void _generateColumnNames</b> (<i>note the underscore in front of the name</i>).</li>
      <li>Compile it.</li>
    </ol>
      <b>
      </b>
    <h2>
    <b>Version History</b></h2>
    <b>1.09 - May 25, 2005</b><br />
    <ul>
      <li>Code merge with the latest 3.21 version of SQLite. </li>
      <li>Removed obsolete methods and properties for Whidbey Beta 2</li></ul>
    <b>1.08 Refresh - Mar 24, 2005<br /></b>

    <ul>
      <li>Code merge with the latest 3.20 version of SQLite.</li>
      <li>Recompiled the help file to fix a build error in it.</li>
    </ul>
    <b>1.08 - Mar 11, 2005<br />
    </b>
    <ul>
Changes to test/Program.cs.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15







16
17
18
19
20
21
22
using System;
using System.Data;
using System.Text;
using System.Data.Common;
using System.Data.SQLite;

namespace test
{
  class Program
  {
    static void Main(string[] args)
    {
      DbProviderFactory fact; // = DbProviderFactories.GetFactory("System.Data.OleDb");
      DbConnection cnn; //  = fact.CreateConnection();








//      cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Temp\\db.mdb;Persist Security Info=False";
//      cnn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DirectLink;Data Source=MASTER";
//      cnn.Open();

//      TestCases.Run(fact, cnn);

      fact = DbProviderFactories.GetFactory("System.Data.SQLite");












|
|

>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Data;
using System.Text;
using System.Data.Common;
using System.Data.SQLite;

namespace test
{
  class Program
  {
    static void Main(string[] args)
    {
      DbProviderFactory fact;
      DbConnection cnn;

      //fact = DbProviderFactories.GetFactory("System.Data.SqlClient");
      //using (cnn = fact.CreateConnection())
      //{
      //  cnn.ConnectionString = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=dlink;Data Source=(LOCAL)";
      //  cnn.Open();
      //  TestCases.Run(fact, cnn);
      //}
//      cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Temp\\db.mdb;Persist Security Info=False";
//      cnn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DirectLink;Data Source=MASTER";
//      cnn.Open();

//      TestCases.Run(fact, cnn);

      fact = DbProviderFactories.GetFactory("System.Data.SQLite");
Changes to test/TestCases.cs.
116
117
118
119
120
121
122

123
124
125
126
127
128
129
    }

    internal static void CreateTable(DbConnection cnn)
    {
      using (DbCommand cmd = cnn.CreateCommand())
      {
        cmd.CommandText = "CREATE TABLE TestCase (ID integer primary key autoincrement, Field1 Integer, Field2 Float, Field3 VARCHAR(50), Field4 CHAR(10), Field5 DateTime, Field6 Image)";

        cmd.ExecuteNonQuery();
      }
    }

    internal static void DropTable(DbConnection cnn)
    {
      using (DbCommand cmd = cnn.CreateCommand())







>







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
    }

    internal static void CreateTable(DbConnection cnn)
    {
      using (DbCommand cmd = cnn.CreateCommand())
      {
        cmd.CommandText = "CREATE TABLE TestCase (ID integer primary key autoincrement, Field1 Integer, Field2 Float, Field3 VARCHAR(50), Field4 CHAR(10), Field5 DateTime, Field6 Image)";
        //cmd.CommandText = "CREATE TABLE TestCase (ID bigint primary key identity, Field1 Integer, Field2 Float, Field3 VARCHAR(50), Field4 CHAR(10), Field5 DateTime, Field6 Image)";
        cmd.ExecuteNonQuery();
      }
    }

    internal static void DropTable(DbConnection cnn)
    {
      using (DbCommand cmd = cnn.CreateCommand())
321
322
323
324
325
326
327

328
329
330
331
332
333
334
            cmd.CommandText = "SELECT * FROM TestCase WHERE 1=2";
            adp.SelectCommand = cmd;

            using (DbCommandBuilder bld = fact.CreateCommandBuilder())
            {
              bld.DataAdapter = adp;
              adp.InsertCommand = bld.GetInsertCommand();

              if (bWithIdentity)
              {
                adp.InsertCommand.CommandText += ";SELECT [ID] FROM TestCase WHERE RowID = last_insert_rowid()";
                adp.InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;
              }

              using (DataTable tbl = new DataTable())







>







322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
            cmd.CommandText = "SELECT * FROM TestCase WHERE 1=2";
            adp.SelectCommand = cmd;

            using (DbCommandBuilder bld = fact.CreateCommandBuilder())
            {
              bld.DataAdapter = adp;
              adp.InsertCommand = bld.GetInsertCommand();

              if (bWithIdentity)
              {
                adp.InsertCommand.CommandText += ";SELECT [ID] FROM TestCase WHERE RowID = last_insert_rowid()";
                adp.InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;
              }

              using (DataTable tbl = new DataTable())
Changes to test/test.csproj.
28
29
30
31
32
33
34
35
36
37
38
39
40


41
42
43
44
45
46
47
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>.\bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\bin\</OutputPath>
    <DefineConstants>
    </DefineConstants>
    <PlatformTarget>x86</PlatformTarget>


  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>







|





>
>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>.\bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>none</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\bin\</OutputPath>
    <DefineConstants>
    </DefineConstants>
    <PlatformTarget>x86</PlatformTarget>
    <FileAlignment>512</FileAlignment>
    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>