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