Shay Well-Known Member Licensed User Longtime User Sep 10, 2011 #1 Hi I am using this when my app is loading File.Copy(File.DirAssets,"data.db",File.DirDefaultExternal,"data.db") (also tried on firstTime only ) inside my code I have update: MainMenu.SQL1.ExecNonQuery("UPDATE Table_1 SET Name='" & TextBox1.Text & "' Where Id='1'") it is updaing the table, since i am calling read again, and I can see the data changed but when I exist the app and enter again, I am getting my old data
Hi I am using this when my app is loading File.Copy(File.DirAssets,"data.db",File.DirDefaultExternal,"data.db") (also tried on firstTime only ) inside my code I have update: MainMenu.SQL1.ExecNonQuery("UPDATE Table_1 SET Name='" & TextBox1.Text & "' Where Id='1'") it is updaing the table, since i am calling read again, and I can see the data changed but when I exist the app and enter again, I am getting my old data
H hdtvirl Active Member Licensed User Longtime User Sep 10, 2011 #2 This might be a stupid question. Shay are you over writing your database when you restart your application. File.Copy(File.DirAssets,"data.db",File.DirDefault External,"data.db") if your app is using the database in DirDefault External, are you writing it back to File.DirAssets when you close your app. Regards BOB Upvote 0
This might be a stupid question. Shay are you over writing your database when you restart your application. File.Copy(File.DirAssets,"data.db",File.DirDefault External,"data.db") if your app is using the database in DirDefault External, are you writing it back to File.DirAssets when you close your app. Regards BOB
Shay Well-Known Member Licensed User Longtime User Sep 10, 2011 #3 I tried also to copy the DB only on firsttime I just tried what ou suggested - on exit File.Copy(File.DirDefaultExternal,"data.db",File.DirAssets,"data.db") but getting error that no such directory for the dirassets what is the best way to copy (from where to where) DB file and then make sure it is saved? Upvote 0
I tried also to copy the DB only on firsttime I just tried what ou suggested - on exit File.Copy(File.DirDefaultExternal,"data.db",File.DirAssets,"data.db") but getting error that no such directory for the dirassets what is the best way to copy (from where to where) DB file and then make sure it is saved?
H hdtvirl Active Member Licensed User Longtime User Sep 10, 2011 #4 Shay, did you cut and paste this line of code out of your app. File.Copy(File.DirDefaultExternal,"data.db",File.D irAssets,"data.db") = if so there is a space in D irAssets this might be your problem. Also copy the database to somewhere you can upload it back to your development PC and using a sqlite browser see if the changes you made are visible on your PC. BOB Upvote 0
Shay, did you cut and paste this line of code out of your app. File.Copy(File.DirDefaultExternal,"data.db",File.D irAssets,"data.db") = if so there is a space in D irAssets this might be your problem. Also copy the database to somewhere you can upload it back to your development PC and using a sqlite browser see if the changes you made are visible on your PC. BOB
agraham Expert Licensed User Longtime User Sep 10, 2011 #5 hdtvirl said: if so there is a space in D irAssets this might be your problem. Click to expand... It is a "feature" of the forum software that inserts additional spaces in lines that have a long run of characters that don't include a space character. Upvote 0
hdtvirl said: if so there is a space in D irAssets this might be your problem. Click to expand... It is a "feature" of the forum software that inserts additional spaces in lines that have a long run of characters that don't include a space character.
Shay Well-Known Member Licensed User Longtime User Sep 10, 2011 #6 the space, seems to be the forum problem what is the best way to copy from and to the DB? I saw in the help that you cannot copy to asset so how do I fix my problem? Upvote 0
the space, seems to be the forum problem what is the best way to copy from and to the DB? I saw in the help that you cannot copy to asset so how do I fix my problem?
klaus Expert Licensed User Longtime User Sep 10, 2011 #7 You should use this code: Code: Copy If Not(File.Exists(File.DirDefaultExternal,"data.db") Then File.Copy(File.DirDefaultExternal,"data.db",File.D irAssets,"data.db") End If Best regards. Upvote 0
You should use this code: Code: Copy If Not(File.Exists(File.DirDefaultExternal,"data.db") Then File.Copy(File.DirDefaultExternal,"data.db",File.D irAssets,"data.db") End If Best regards.