这里有问题,不知道出了什么问题……顺便说一句,这是在 C# 中。
Problem with DB: SQLite error
near "s": syntax error
这是查询:
INSERT INTO information (name, picfolder, picstore) VALUES ('My Name','V:\Folder Path\Folder',1)
该表是用这个创建的:
CREATE TABLE information (name VARCHAR(255), picfolder VARCHAR(255), picstore BOOLEAN)
所有 c# 代码(要求):
try
{
query = "CREATE TABLE information (name VARCHAR(255), picfolder VARCHAR(255), picstore BOOLEAN)";
SQLiteCommand command1 = new SQLiteCommand(query, db); command1.ExecuteNonQuery();
}
catch (Exception error)
{
MessageBox.Show("Problem with DB: " + error.Message);
db.Close(); System.IO.File.Delete(this.created_path);
this.created_path = null; return;
}
try
{
query = "INSERT INTO information (name, picfolder, picstore) VALUES ('" + name + "','" + folder +"'," + (copy ? 1 : 0).ToString() + ")";
SQLiteCommand command2 = new SQLiteCommand(query, db); command2.ExecuteNonQuery();
}
catch (Exception error)
{
MessageBox.Show("Problem with DB: " + error.Message + "\n"+query);
db.Close(); System.IO.File.Delete(this.created_path);
this.created_path = null; return;
}