How to Use DAC to operate SQLite databases on Windows Mobile

Source: Internet
Author: User
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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.