Hi i am using FMDB to retrieve data from SQLITE database.
db = [[FMDatabase alloc] initWithPath:path];
[db open];
FMResultSet *fResult= [db executeQuery:@"SELECT * FROM Users"];
aUsers = [[NSMutableArray alloc] init];
while([fResult next])
{
userData = [fResult stringForColumn:@"Name"];
lblUsers.text=[lblUsers.text stringByAppendingString:userData];
[aUsers addObject:userData];
NSLog(@"The data is %@=",userData);
}
[db close];
[aUsers release];
[db release];
So i got output to this program is
Sachin Rahul Dravid
But when i try to insert data to the databse, i used the following coding
[db beginTransaction];
[db executeUpdate:@"insert into users (name) values('Balaji R')" ,nil];
[db commit];
Now i again retrieve the data from database. So i got a output like this
Sachin Rahul Dravid Balaji R
But when i quit my application and then bulid it again, Now i am seeing only the old records
Sachin Rahul Dravid
The inserted recorded "Balaji R" gone away!
Anybody know where i did the mistake?Please tell me the solution......