所以我试图用 SQLite3 在我的数据库中插入一个新行,由于某种原因,我遇到了一个 SQL 逻辑错误。
Database dbObject = new Database();
string query = "INSERT INTO info ('firstName, lastName, email') VALUES (@firstName, @lastName, @email";
SQLiteCommand myCommand = new SQLiteCommand(query, dbObject.Connection); //Opens chain of commands
dbObject.OpenConnection();
myCommand.Parameters.AddWithValue("@firsName", "blank name");
myCommand.Parameters.AddWithValue("@lastName", "blank last name");
myCommand.Parameters.AddWithValue("@email", "blank@gmail.com");
var result = myCommand.ExecuteNonQuery();
dbObject.CloseConnection();
Console.WriteLine("Rows added: {0}", result);
Console.ReadKey();
有人可以告诉我我做错了什么吗?谢谢!