Introduction to using SQLite database in C # (I ),

Source: Internet
Author: User

Introduction to using SQLite database in C # (I ),

[SQLite database]

SQLite is an open-source lightweight desktop database that stores almost all database elements (including definitions, tables, indexes, and data) in a single file. SQLite is written and implemented in C, which has good performance in terms of memory consumption, file volume, operation performance, and simplicity. SQLite can run on multiple platforms, including mainstream systems such as Windows, Linux, and Unix, and supports embedded systems such as Android and Windows Mobile.

SQLite has the following features: implementing the standards of most SQL92, including transactions (atomicity, consistency, isolation and durability), triggers, and most complex queries. Do not check the type of inserted or updated data. For example, you can insert a string into an integer column.

Currently, SQLite Version 3 supports five data types:

1. NULL: NULL.

2. INTEGER: A signed INTEGER, which is stored in 1, 2, 3, 4, 6, or 8 bytes.

3. REAL: floating point number.

4. TEXT: TEXT, stored in character set UTF-8, UTF-16BE, or UTF-16LE, depending on the database encoding format.

5. BLOB: a binary byte sequence. It generally stores objects that are not easy to use numeric values or text representation, but theoretically stores anything.

If compared with some commonly used databases, we can find that the bit and DateTime types are missing at least. In fact, in SQLite, the bit and INTEGER types usually share the INTEGER type, dateTime shares the TEXT type. When the INTEGER type field value is 0 or 1, SQLite can use it as a bit type (true or false). When the TEXT type field value conforms to a certain format, SQLite can be used as DateTime. The commonly used text format of DateTime can be seen as yyyy-MM-dd Or yyyy-MM-dd HH: mm: ss. Note: strings "" are valid date formats, while strings "", "", and "2012-01-9" are treated as DateTime invalid.

[How to connect to SQLite in C]

The most common is System. data. SQLite. dll Data Access driver, which is specially designed for SQLite. net design and development, as long as the dll file is referenced in the project without installing anything else, it is recommended to use.


In the C language, what is the symbol (->) and how to use it?

This is a symbol in the struct pointer. Write a program to explain it, for example:
# Include <stdio. h>
Struct STU // define a struct
{
Int num;
} Stu;
Int main ()
{
Struct STU * p; // defines a struct pointer.
P = stu; // p points to the struct variable stu.
Stu. num = 100; // attaches an initial value to the struct member num.
Printf ("% d", p-> num); // output the num value in stu
Return;
}
As you can see, the-> method is to reference the variable in the struct !!
Format: p-> struct member (such as p-> num)
The function is equivalent to stu. num or (* p). num.
I don't know. You don't understand, and don't understand call me. O (∩ _ ∩) O ~
Hope to adopt it.

In the C language, what is the symbol (->) and how to use it?

This is a symbol in the struct pointer. Write a program to explain it, for example:
# Include <stdio. h>
Struct STU // define a struct
{
Int num;
} Stu;
Int main ()
{
Struct STU * p; // defines a struct pointer.
P = stu; // p points to the struct variable stu.
Stu. num = 100; // attaches an initial value to the struct member num.
Printf ("% d", p-> num); // output the num value in stu
Return;
}
As you can see, the-> method is to reference the variable in the struct !!
Format: p-> struct member (such as p-> num)
The function is equivalent to stu. num or (* p). num.
I don't know. You don't understand, and don't understand call me. O (∩ _ ∩) O ~
Hope to adopt it.

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.