4rdn1_s
Member
Hi,
I'm trying to save a record that contain Blob data type but it always unsuccessful and I don't understand why,
here's my code, maybe someone can help me.
Thanks
And Here 's The Error :
(MySQLSyntaxErrorException) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[B@68f7b30,'2022-09-21')' at line 1
I'm trying to save a record that contain Blob data type but it always unsuccessful and I don't understand why,
here's my code, maybe someone can help me.
Thanks
Blob Saving Error:
Dim Buffer() As Byte = ImageToBytes(Foto)
Msgbox2Async("Save data ??","","Yes","Cancel","",Null,True)
Wait For Msgbox_Result(Result As Int)
If Result = DialogResponse.POSITIVE Then
DateTime.DateFormat="yyyy-MM-dd"
Wait For (CallSub(Starter,"Connect")) Complete (Success As Boolean)
If Success Then
Try
Starter.mysql.AddNonQueryToBatch("Insert into t_dpt(no_kk,no_nik,nama,kota_lahir,tgl_lahir,status_kawin,jenis_kelamin,alamat,no_rt,no_rw,kelurahan," & _
"kecamatan,kota,propinsi,no_tps,disabilitas,status_perekaman,nm_ts,cek,keterangan,aktif_partai,foto_file,dt) Values(" & _
"'" & EditText7.text & "','" & EditText1.Text & "','" & EditText4.Text & "','" & nmKota & "'," & _
"'" & DateTime.Date(AnotherDatePicker1.Date) & "','" & idKawin & "','" & idJkel & "','" & Starter.Remvpetik(EditText6.Text) & "'," & _
"'" & EditText9.Text & "','" & EditText8.Text & "','" & nmKel & "','" & nmKec & "'," & _
"'" & nmKab & "','" & nmProp & "','" & Spinner6.SelectedItem & "','" & idDisA & "'," & _
"'" & idRekam & "','" & NmTS & "'," & IIf(Check1.Checked,1,0) & ",'" & Starter.Remvpetik(EditText2.Text) & "'," & _
"'" & Starter.remvpetik(EditText3.Text) & "',[B]" & Buffer & "[/B],'" & DateTime.Date(DateTime.Now) & "')",Null)
Dim RsObj As Object = Starter.mysql.ExecNonQueryBatch("Mysql")
wait for (RsObj) Mysql_NonQueryComplete (Success As Boolean)
If Success Then
MsgboxAsync("Record Saved.","Success")
.....
Else
Success = False
Log(LastException)
MsgboxAsync("An error occurred.","Fail")
End If
And Here 's The Error :
(MySQLSyntaxErrorException) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[B@68f7b30,'2022-09-21')' at line 1