안녕하세요 코드는 구문 오류를 제공합니다. 문제를 해결하는 방법을 모르겠습니다.Sqlite "업데이트"C# 구문 오류
오류
{myText를 \ "SQLite는 오류 \ 연구 \ nnear \" "구문 오류"}
내 코드
string dataSource = "Database.s3db";
SQLiteConnection connection = new SQLiteConnection();
connection.ConnectionString = "Data Source=" + dataSource;
connection.Open();
SQLiteCommand command = new SQLiteCommand(connection);
command.CommandText = ("update Example set Info ='" + textBox2.Text + ", Text ='"+textBox3.Text + "where ID ='" + textBox1.Text +"'");
command.ExecuteNonQuery();
이런 종류의 오류 (및 SQL 주입)를 방지하려면 SQL 명령 문자열을 동적으로 작성하지 말고 조회 매개 변수를 사용해야합니다. – svick
@ user1248067 : * 허용되는 답변을있는 그대로 사용하지 마십시오. 매개 변수화 된 SQL을 사용해야합니다. –