jeudi 11 juin 2015

Sqlite WHERE Clause using Parameters

Trying to run a specific query using a where clause, here is what I have.

ID = "Blah!"
SqliteParameter Identifier = new SqliteParameter ("@ID", ID);
string SQLText = "SELECT Value FROM Table WHERE Value=@ID;"
SqliteCommand Command = new SqliteCommand (SQLText, Database);
Command.Parameters.Add (Identifier);
string Result = Comand.ExecuteScalar ().ToString ();
return Result;

The Error I get is:

SqliteSyntaxException: near "="; syntax error

What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire