We all know that programs developed with. Net generally use SQL Server databases. But it is not suitable for some small projects. First, there is no need to install SQL Server for small projects, and second, the License of SQL Server is too expensive, not suitable for small projects.
MySQL, access, and SQLite are recommended for small projects. Access can be used directly in systems earlier than xp. MySQL requires a 30 M installation package or a local file package of over 10 m in windows. I used to use access all the time, but recently I found that the SQLite database is very good. I would like to introduce it to you.
In fact, SQLite is well known in embedded programs and is completely free of charge. Official Website for http://www.sqlite.org/
SQLite, like access, is a single file. That is to say, without the database engine, the database file is a file on the disk. SQLite also supports indexes, views, and triggers. These are better than access.
Good management tools are also required. I recommend SQLite administrator or sqlitespy. You can find their latest version online. The following are two figures: the first is SQLite administrator and the second is sqlitespy.
The above two tools can complete the general work of SQLite. For example, database creation, table creation, and query.
If you want to connect to and operate SQLite using. net, you must download the SQLite class library system. Data. SQLite. dll, which can be found on Microsoft's official website. Then reference this DLL in the program. Similar to ado.net, it connects to SQL Server and also has controls such as connect, command, and adapter. The specific operations will not be mentioned.
In terms of usage, I found a problem, that is, the newline carriage return (/R/N) is saved in the SQLite database, and is converted to/N in SQLite, that is, the string read from SQLite must be converted using Replace ("/N", "/R/N"). Otherwise, all the characters will be connected and the carriage return will be skipped.
I have used SQLite in a recent project and it feels good. So I will share it with you. Please kindly advise on anything wrong.