Per ovviare al problema dell'injection potresti anche usare questa forma che ho utilizzato
nel mio codice per costruire le query
Codice PHP:
SqlCommand _sql = new SqlCommand();
_sql.CommandText = "Select * from nometabella where id = @id_utente";
_sql.Connection = _dbconn;
_sql.Parameters.AddWithValue("@id_utente", TextBox.text);