Android Question Join sqlite with condition where

FabioCirillo

Member
Licensed User
Longtime User
hi,
i've this code:

Dim cursor As Cursor
cursor = sqldb.ExecQuery("SELECT partecipanti.id,squadre.nome FROM partecipanti JOIN squadre ON partecipanti.idsquadra=squadre.id WHERE partecipanti.idtorneo =?", Array As String(frmtorneo.idtorneo))

and in this code there's an error, the error message is: "Too many parameters"

where am I wrong?
 

tipallandgo

Member
Licensed User
Longtime User
ExecQuery only accepts 1 parameter. You can try building the string query first to include your parameters before calling ExecQuery.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
did you try it like this?

Dim cursor As Cursor
cursor = sqldb.ExecQuery("SELECT partecipanti.id,squadre.nome FROM partecipanti JOIN squadre ON partecipanti.idsquadra=squadre.id WHERE partecipanti.idtorneo =" & frmtorneo.idtorneo)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…