I used to be SQL Server database, but the customer there think that the installation of this large database comparison card, said to lead to blue screen, hard to SQL Server, no way customer is God, give him a small point of the database it! Consider Acess, No. This still has to install the client, you must find a free installation. Finally found SQLite, do not install the client, only need a file on the line, create a new text file locally, the suffix named. db, open the. db file with SQLite Studio software. but my previous data was done with SQL Server, which required converting data from SQL Server to SQLite,
This is the time to use a SQL server to SQLite DB Convert This tool, you can go to Baidu search to find it, is an open source of the foreigner write software, very good, the conversion will be completed soon. when converting, you need to be careful: if there are often spaces behind the data in the SQL Server table, this is the time to remove the trailing spaces in SQLite studio or not to query the data.
When the conversion is complete, a. db file is generated and then opened with SQLite Studio, which is very simple. And then in the code of SQL DataAdapter This SQL prefix all to SQLite, the SQL Server database operation of the several objects, in SQLite, but the name prefix is different, from SQL to SQLite, So a very simple way to modify the previous ADO is to replace the whole project with the SQL instead of SQLite.
String connectionString = "Data Source =" + environment.currentdirectory + @ "\test.db";
conn = new sqliteconnection (connectionString);
I tested it myself, query 7 tables, combined query a total of 700多万条 data, SQLite studio only need 0.002 seconds, but SQL Server needs 2 minutes and a half time, so SQLite is a very good database.
Another thing is that data security has not been done and put locally. DB, others can directly access, seems to be, so feel very insecure, next to study the method of data file encryption.
How databases are converted from SQL Server to SQLite