Recently, I took a small project in the United States. The main requirement is to combine the data exported from the disk (DBF format) with other data (CSV format) to generate a new data table, which facilitates query and error correction. The other party does not install MS Access. Considering the convenience of use by the other party, SQLite is used and. NET 2.0 is used as the development language. The following is a brief list of some experiences in the use process.
Provider: Provider decides to use system. Data. SQLite by using other open-source software and online search.
Transaction (dbtransaction): Data import and merge, batch insertion, and update are required. transactions are not explicitly called at the beginning, so the speed is not too slow, therefore, it is assumed that SQLite is slower than access. Later, the search found that SQLite started a transaction for each operation by default. In fact, this is the basic knowledge of database operations. Not only does SQLite need to pay attention to this, of course, access and other transactions are not supported here.
Index): Data import and merge. when inserting and updating data, you must check whether the data is duplicated and exists. Therefore, indexes cannot be missing.
SQliteparameter: When batch inserts are performed, string is used to save the trouble. format to format the insert. The result is "near" S ": Syntex error. ", after tracking, it turns out to be a single quotation mark (') problem, it seems that it is cool to use sqliteparameter to standardize the import, and can avoid many character problems.
Update... from (cross join in update): SQLite does not support similar
"Update tbl1 set col2 = tbl2.col2
From Table1 tbl1 inner join Table2 tbl2 on tbl1.col1 = tbl2.col1"
The alternative solution is:
Update Table1 set col2 = (select col2 from Table2 where table2.col1 = table1.col1 limit 1)
Where exists (select * From Table2 where table2.col1 = table1.col1 );
Query Analyzer: I chose SQLite administrator. Later I found that the Firefox plugin (Addons) SQLite manager is also a good choice.
Some SQLite-related projects developed by DOTNET are listed below:
Convert SQL Server dB to SQLite DB: C # utility to automatically do the conversion from SQL Server dB to SQLite dB (a tool that automatically converts ms SQL Server database to SQLite dB, including source code ).
SQLite membership, role, and profile providers: complete, production-ready membership, role, and profile providers for SQLite. Supported des instructions for migrating data between SQL Server and SQLite.