Ok , I tried but , Just cant see though
I think the problem is from INSERT INTO .
If I add the data ,another layout opens. It says new ID is added, but after I return Main menu (at SQLite Light2)
I cannot see new added data, AND if want to add new data again, it contunie from last new ID , and it seems goes normal from last ID. But whenever I go to main layout I cannot see . sorry about my english. I hope I could intreduce myself what I mean.
Do I rith code for persons.db TWO TABLES which is persons and body
[Sub AddEntry]
[Dim Query As String]
[Dim Cursor1 As Cursor]
[Dim ID As Int]
[Query = "SELECT * FROM persons WHERE FirstName = ? AND LastName = ? AND Sex= ? AND BirthDay = ? AND BirthCity = ? AND FatherName = ?" ]
[Cursor1 = Activity2.SQL1.ExecQuery2(Query, Array As String (edtFirstName.Text,edtLastName.Text,edtSex.Text,edtBirthDay.Text,edtBirthCity.Text,edtFatherName.Text))]
[If Cursor1.RowCount > 0 Then]
[ToastMessageShow("This entry already exists", False)]
[Else]
[Query = "INSERT INTO persons VALUES (NULL, ?, ?, ?, ?, ?, ?, ?)"]
[Activity2.SQL1.ExecNonQuery2(Query, Array As String(edtFirstName.Text,edtLastName.Text,edtSex.Text,edtBirthDay.Text,edtBirthCity.Tex,edtFatherName.Text))]
[ToastMessageShow("Entry added", False)]
[ID = Activity2.SQL1.ExecQuerySingleResult("SELECT max(ID) FROM persons ")][Activity2.RowNumber = Activity2.RowNumber + 1]
[Activity2.IDList.Add(ID)]
[Activity2.CurrentIndex = Activity2.IDList.Size - 1]
[edtID.Text = ID]
[End If]
[Cursor1.Close]
[ShowButtons]
[/End Sub ]