Updated to v10.5
Could not catch DBErrors while using InsertMap. My code is
Dim lb_saved = False As Boolean
Try
Dim ls_result As String = DBUtils.InsertMaps(Main.gs_sql, "co_mobile_registration", co_mobile_registration)
Log("ls_result : " & ls_result)
lb_saved = True
Catch
Log("Exception : " & LastException)
lb_saved = False
MsgboxAsync("Error While Saving Data. Retry...","Error")
End Try
If lb_saved = True Then
ToastMessageShow("Registration Information saved",False)
is_fullname.Text = ""
is_mobilenumber.Text = ""
is_password.Text = ""
is_confirmpassword.Text = ""
StartActivity(login_choice)
Activity.Finish
Else
is_fullname.RequestFocus
End If
Code executed [ as in the log]
InsertMaps (first query out of 1): INSERT INTO [co_mobile_registration] ([mobileregistrationpk], [fullname], [mobilenumber], [password], [regstatus], [sentstatus], [updateon]) VALUES (?, ?, ?, ?, ?, ?, ?)
And returns
(SQLiteConstraintException) android.database.sqlite.SQLiteConstraintException: column mobileregistrationpk is not unique (code 19)
I expect the cursor to move to field fullname, but it displays 'Registration Information saved' message and closes that activity, as if no error has happened.
Am I doing anything wrong in capturing the DB Error ?
Thanks.