c# - SQLite injection with list of strings -


Can someone tell me that to prevent SQL injection on SQLite creating questions Where is a method where in the section a "myval IN (string_1, ..., string_n)" condition?

Although I'm dynamically creating and adding command text with annotations, is there an easy way to get those annotation parameters from the string list?

Thank you.

No, there is no easy way. Do not create a list of hazardous characters. Use the command with parameters. (Var command = conn.CreateCommand ()) (using conn.Open ()) using conv = new SQLiteconnection (connectionString)

  command. Command. Command Text: "Choose names from persons where id = @id"; Command. Parameter. Advant Value ("@ id", 5); {Reader.Read ()} {}}}  
while using Var reader = command.ExecuteReader ())

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -