1. In the SQLite database, the data type returned by Interger is Int64 bit. If you want to convert to C # int type, you must first convert to Int64 and then to int type. Such as:
int id = (int) (Int64) dt.rows[0]["id"];
The int type is converted to C#int and can be converted directly, such as:
int isdel = (int) dt.rows[0]["Isdel"];
2. When the database is established, the self-increment field must be of type Interger.
3. Password-free string connection:
SqlHelper part of the content
Private Static stringstrconn = configurationmanager.connectionstrings["Adostr"]. ConnectionString; Public Static intExecuteNonQuery (stringSqlparamssqliteparameter[] Parameters) { using(Sqliteconnection conn =Newsqliteconnection (strconn)) {Conn. Open (); using(Sqlitecommand cmd =Conn. CreateCommand ()) {Cmd.commandtext=SQL; Cmd. Parameters.addrange (Parameters); returncmd. ExecuteNonQuery (); } } }
View Code
App.
<?xml version="1.0" encoding="utf-8" ?>< configuration> <connectionStrings> <add name="adostr" connectionstring="Data source=e:/sqlite/data/passworddb.db"/> </ Connectionstrings></configuration>
View Code
SQLite question Notes