I need to add initial values to SQLite database, once application is started first time. How should I do it?
One time or first-load requirements like this are common.
1) Set a flag variable named FIRSTLOAD and set it to True. Be sure to save this variable to isolated storage in the device to read back each time the application is started. 2) Create a method which checks the value of FIRSTLOAD and only executes if FIRSTLOAD is true. Place your code which 'add[s] initial values to SQLite database' here. Then set the FIRSTLOAD variable to false. This way it will only execute the code once!
Boolean FIRSTLOAD= new Boolean("true");
void SetInitialValues()
{
if(!FIRSTLOAD)
return;
// insert your code to run only when application is started first time here
FIRSTLOAD = False;
}