Android Question Insert Record in to Table - Sqlite

Pancha

New Member
I am a newbie and a beginner of SQL.

sq.ExecNonQuery2("INSERT INTO tab1 values (?,?,?,?,?,?)",Array As String(EditText1.Text,EditText2.Text,Spinner1.SelectedItem,EditText3.Text,Typ,Dt)

What is wrong with the above code?

I am getting the following error message
================================================================
Parsing code. Error
Error parsing program.
Error description: Invalid number of parentheses.
Occurred on line: 205
sqc = sq.ExecNonQuery2("INSERT INTO tab1 values (?,?,?,?,?,?)",Array As String(EditText1.Text,EditText2.Text,Spinner1.SelectedItem,EditText3.Text,Typ,Dt)
================================================================


Please Help me

Thanks
 

barx

Well-Known Member
Licensed User
Longtime User
count the ()'s you need another ) on the end.
 
Upvote 0

Pancha

New Member
count the ()'s you need another ) on the end.

Thank you sir for your time and support

i have changed the code like this:
sq.ExecNonQuery2("INSERT INTO tab1 values (?,?,?,?,?,?)",Array As String(EditText1.Text,EditText2.Text,Spinner1.SelectedItem,EditText3.Text,Typ,Dt))

Now a new error occurred while running the code
==================================================================
Parsing code. 0.01
Compiling code. Error
Error compiling program.
Error description: Cannot assign void value.
Occurred on line: 205
sqc = sq.ExecNonQuery2("INSERT INTO tab1 values (?,?,?,?,?,?)",Array As String(EditText1.Text,EditText2.Text,Spinner1.SelectedItem,EditText3.Text,Typ,Dt))
Word: )
==================================================================

Please Help me
 
Last edited:
Upvote 0
Top