Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

The correct use of a variable in a SQL QUERY

Feb 26 2003 8:48 AM
I would like to know as to use a variable in a SQL QUERY. I have a variable called NOMEGENERO that contains the name "JOSE" for example. what is the correct SQL QUERY using this variable. I'm trying to use: thisAdapter = new OleDbDataAdapter( "SELECT n_genero FROM genero WHERE genero = '+ nomegenero'", dbBanco.thisConnection);). But is wrong. How can i use the variable NOMEGENERO correctly? Debtor for the attention Andre

Answers (1)