How can I escape strings in System.Data.SQLite without using parameters? I'm building a potentially large INSERT query like so.
string sql = "INSERT INTO Request (Col1, Col2, Col3) VALUES ";
bool hasValue = false;
foreach (TestItem item in order.Tests)
{
if (hasValue)
sql += ", ";
hasValue = true;
sql = sql + String.Format("('{1}', '{2}', '{3}')", sql, a, b, c);
}
using (SQLiteCommand command = new SQLiteCommand(sql, _database))
command.ExecuteNonQuery();
I could break each insert into a separate query, but wouldn't it be more efficient to escape the strings myself? I could generate query parameters dynamically, but couldn't the parameter list get too large?