1, open the database:
Note: Open a database, the filename does not necessarily exist, if this file does not exist, SQLite will be created automatically. The first parameter refers to the file name, and the second parameter is the defined sqlite3 * *
This article illustrates the method of C # operation SQLite database. Share to everyone for your reference, specific as follows:
This shows the reading and writing of the database and displaying its data in the form, in the following ways:
Read:
Recently in the project, accidentally heard that there is a database of sqlite, compared to their previous use of SQL Service is very light, in the data integrity, concurrency requirements are not high in the scenario can be tried! 1, SQLite
1 Open the database filesqlite3* m_db = NULL;int ret = SQLITE3_OPEN_V2 ("Test.db", &db, Sqlite_open_readwrite, NULL);if (ret! = SQLITE_OK){Return}2 If the table does not exist, create a tableChar szcreateuserdatasql[1024] = "CREATE table if not
1)Fts2 has a designflaw and have been deprecated2)Fts1 has a designflaw and have been deprecated solution: parse: fts1 and Fts2 There are design flaws that are now obsolete and have been provided Fts3 or fts4 Fts1 > the shortage. If you are
With the use of idea, the problem is more and more, start the second summary of the problem.1, shortcut keys.Using Eclipse and using idea, shortcut keys are a big problem.And there are very many versions of the shortcut keys for online idea. Do not
How to update SQLite complex tables in SQLite, if the tables you designed earlier do not meet your needs, you need to update the tables, such as modifying names and adding columns. If it is relatively easy to modify for a simple table, use the ALTER
Intent:This function can be used to pass the signal to the principle page through intent to jump the interface, in order to make some processing:Use of SQLite:The method gets sqlitedatabase readable and writable, while Getreadabledatabase is
Copyright: Little White qq:99565687DOS command:①sqlite3--into sqlite3 inside to operate②sqlite3 database name--declares a database to be created③.databases--creating a declared database④.tables--to view all table names in the entered
1. Self-Growth of primary keys
If row_id is the primary key of a table, if auto increment is set in DDL, if it is set to null during insert row_id, the primary key can grow from 1.
However, if a problem occurs after the previous record is deleted
During development, a lot of Preset information is often stored in the database at a time. It is a headache for new users.
It is impossible to use the for loop to execute the inert statement once and again. The efficiency is very low. It takes a
Reprinting is also helpful. After reading this article, I understand, update
In addition to the execsql () and rawquery () methods described earlier, sqlitedatabase also provides operations corresponding to adding, deleting, updating, and
Use the begintransaction () method of sqlitedatabase to start a transaction. When the program runs to the endtransaction () method, it checks whether the transaction flag is successful. If the program runs to the endtransaction () method ()
I have mentioned the problem of persistent access to sharedpreference and file operations data in Android Application Development. Today I will introduce the detailed operations of SQLite applications in Android:
In Android Application Development,
Original Works are allowed to be reprinted. During reprinting, be sure to indicate the source of the article: Ghost. Otherwise, legal liability will be held.
1. Use adb.exe to find a running device (at least one simulator must be enabled)
E: \
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