System.Data.SQLite.SQLiteException: "SQL logic error no such column: Caesar"
SQLiteCommand cmd = conn.CreateCommand(); string sql_command = "DROP TABLE IF EXISTS person;" + "CREATE TABLE person(" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT, " + "sex TEXT, " + "age INTEGER, " + "salary INTEGER, " + "position TEXT, " + "place INTEGER);"; for (int i = 0; i < 100; i++) { sql_command += "INSERT INTO person(name, sex, age, salary, position, place) " + "VALUES (" + workers_names[i] + ", " + people_gendar[i] + ", " + age[i] + ", " + salary[i] + ", " + people_position[i] + ", " + place[i] + "); "; } cmd.CommandText = sql_command; Console.WriteLine(sql_command); Console.WriteLine(cmd.ExecuteNonQuery()); try { Console.WriteLine(cmd.ExecuteNonQuery()); } catch (SQLiteException ex) { Console.WriteLine(ex.Message); }
sql_command, which gives an error - tym32167+! Use parameters to pass the inserted values: msdn.microsoft.com/en-us/library/… - PashaPash ♦