Pravee7094
Active Member
Hi all,
I write one condition, If database (SQLITE) regstatus (Registration status) is "D" then I just get all the data before entered. and copy the empty database then entered new values. and finally close the activity. (In starter service)
Coding is Here,
but it does not copy the empty database.
Anybody Help?
Regards
Praveen
I write one condition, If database (SQLITE) regstatus (Registration status) is "D" then I just get all the data before entered. and copy the empty database then entered new values. and finally close the activity. (In starter service)
Coding is Here,
B4X:
If regstatus = "D" Then
Dim rs As ResultSet = Main.gs_sql.ExecQuery("SELECT fullname,mobilenumber,password,regstatus,keyvalue,sendstatus,updateon FROM tablename")
Do While rs.NextRow
Dim ls_fullname As String = rs.GetString("fullname")
Dim ls_mobilenumber As String = rs.GetString("mobilenumber")
Dim ls_password As String = rs.GetString("password")
Dim ls_regstatus As String = rs.GetString("regstatus")
Dim ls_keyvalue As String = rs.GetString("keyvalue")
Dim ls_sendstatus As String = rs.GetString("sendstatus")
Dim ls_updateon As Int = rs.GetString("updateon")
Loop
rs.Close
Copy_StartupFiles
Dim co_mobile_registration As List
co_mobile_registration.Initialize
Dim lm_map As Map
lm_map.Initialize
lm_map.Put("fullname",ls_fullname)
lm_map.Put("mobilenumber", ls_mobilenumber )
lm_map.Put("password", ls_password)
lm_map.Put("regstatus", "D" )
lm_map.Put("keyvalue", ls_keyvalue )
lm_map.Put("sendstatus", ls_sendstatus )
lm_map.Put("updateon", ls_updateon)
co_mobile_registration.Add(lm_map)
DBUtils.InsertMaps(Main.gs_sql, "tablename", co_mobile_registration)
Close_Activity
StartActivity(login_choice)
ToastMessageShow("Your Login has been deleted. Contact HeadOffice / Admin",True)
End If
B4X:
Sub Copy_StartupFiles
File.Copy(File.DirAssets,Main.gs_databasename,File.DirInternal,Main.gs_databasename)
' Log("DataBase Name : " & Main.gs_databasename)
End Sub
but it does not copy the empty database.
Anybody Help?
Regards
Praveen
Last edited: