Android Question Insert Data to SqlLite from EditText

D074

New Member
Hello,

please help me,

I dont know why my code error pause in this line code :

s.ExecNonQuery2("INSERT INTO identitas VALUES(?, ?, ?, ?)", Array As String(" "txtNama.Text &" "," "& txtAlamat.Text &" "," "& txtUsername.Text &" "," "& txtPassword.Text &" "))

but when I change the line code to be :

s.ExecNonQuery2("INSERT INTO identitas VALUES(?, ?, ?, ?)", Array As String("'"txtNama.Text &"'","'"& txtAlamat.Text &"'","'"& txtUsername.Text &"'","'"& txtPassword.Text &"'"))

it works, but store the sign ('), while I dont want the sign saved include the value of text. please help me.
 

DonManfred

Expert
Licensed User
Longtime User
s.ExecNonQuery2("INSERT INTO identitas VALUES(?, ?, ?, ?)", Array As String("'"txtNama.Text &"'","'"& txtAlamat.Text &"'","'"& txtUsername.Text &"'","'"& txtPassword.Text &"'"))

Try it like this
B4X:
s.ExecNonQuery2("INSERT INTO identitas VALUES(?, ?, ?, ?)", Array As String(txtNama.Text,txtAlamat.Text,txtUsername.Text,txtPassword.Text))
 
Upvote 0
Top