I am writing a small XAML/C#/MySQL database and wanted to create a query that accepts parameters. However, the test query that I am setting up fails when I try to create it
var con = new MySqlConnection(ClsVariables.StrDb);
con.Open();
var command = new MySqlCommand("", con);
command =
new MySqlCommand("Create View r2_Add_Edit_View as SELECT era.contact_id, era.n_family FROM era WHERE era.contact_id = @ContactID", con) command.ExecuteNonQuery();
con.Close();
When I change the @ContactID to a specific number - it works fine.
After that I will need to create a recordset, and pass the parameter to it (but I can ask that in a secondary question).
Thanks as always.