The procedure is as follows:
1. Download SQLite engine and. net Provider. Address: http://sqlite.phxsoftware.com/
2. Add a reference to "System. Data. SQLite. dll" and "RaisingStudio. DAC. dll" in the project.
3. Create an xml file named "providers. config" under the project. The content configuration is as follows:
Code <? Xml version = "1.0" encoding = "UTF-8"?>
<Providers xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance">
<Clear/>
<Provider name = "SQLite"
Description = "SQLite, System. Data. SQLite Interop Library v1.0.65.0"
Enabled = "true"
AssemblyName = "System. Data. SQLite, Version = 1.0.65.0, Culture = neutral, PublicKeyToken = 1fdb50b1b62b4c84"
ConnectionClass = "System. Data. SQLite. SQLiteConnection"
CommandClass = "System. Data. SQLite. SQLiteCommand"
ParameterClass = "System. Data. SQLite. SQLiteParameter"
ParameterDbTypeClass = "System. Data. DbType, System. Data, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 969db8053d3322ac"
ParameterDbTypeProperty = "DbType"
DataAdapterClass = "System. Data. SQLite. SQLiteDataAdapter"
CommandBuilderClass = "System. Data. SQLite. SQLiteCommandBuilder"
UsePositionalParameters = "false"
UseParameterPrefixInSql = "true"
UseParameterPrefixInParameter = "true"
ParameterPrefix = "@"
SetDbParameterPrecision = "false"
SetDbParameterScale = "false"
AllowMARS = "false"
/>
</Providers>
* Note: Modify the version of the referenced System. Data. SQLite. dll accordingly.
4. Add the configuration file "connections. config": content:
Code <? Xml version = "1.0" encoding = "UTF-8"?>
<Connections>
<Connection providerName = "SQLite"> Data Source = \ Program Files \ SmartDeviceProject3 \ Data \ sqlite. db; Pooling = true; FailIfMissing = false </connection>
</Connections>
5. Compile and run. * Note: During running, you must copy "SQLite. Interop.065.DLL" (note version), "providers. config", "connection. config", and the corresponding database files to the running directory.
Example: Download
See: http://dac.codeplex.com/WorkItem/View.aspx? WorkItemId = 4034