I have this code and I want to prevent SQL injection
¿What I can change in this code?
protected void ENTER_Click(object sender, EventArgs e)
{
using (MySqlConnection conn = new MySqlConnection("server=localhost;User Id=root;Password=root;Persist Security Info=True;database= data"))
{
conn.Open();
string query = @"SELECT * FROM data WHERE user = '" + txtuser.Text + "' AND password = '" + txtpassword.Text + "' ";
MySqlCommand cmd = new MySqlCommand(query, conn);
MySqlDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
Session["id"] = Convert.ToInt32(reader["id"]);
Response.Redirect("Frames.aspx");
}
}
}

or is there another way to prevent SQL injection?
thanks