if (![txt_odays.text isEqualToString
""] && ![txt_pdays.text isEqualToString: @""] && ![txt_hmdcycle.text isEqualToString
""] && ![txt_hmdpstart.text isEqualToString
""] && ![txt_hmdplast.text isEqualToString
""] && ![txt_pstartdate.text isEqualToString
""])
{
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
NSString *str_username=[defaults stringForKey
"keyforusername"];
{
const char* updateSql;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent
"DatingDB.sql"];
//NSUInteger fromRow = [fromIndexPath row]+1;
//NSUInteger toRow = [toIndexPath row]+1;
//1000 is used as temporary SoundbrdID
if(sqlite3_open([writableDBPath UTF8String],&db)==SQLITE_OK)
{
updateSql=[[NSString stringWithFormat
"UPDATE Userdates SET P_Start_Date='%@',HMD_cycle='%@',HMD_Plast='%@',HMD_Pstart='%@',P_days='%@',O_days='%@' WHERE UserName='%@'",txt_pstartdate.text,txt_hmdcycle.text,txt_hmdplast.text,txt_hmdpstart.text,txt_pdays.text,txt_odays.text,str_username]cStringUsingEncoding:NSUTF8StringEncoding];
retVal=sqlite3_exec(db,updateSql,NULL,NULL,&str1);
}
else
{
UIAlertView *alert =[[UIAlertView alloc] initWithTitle
"alert" message
"Not entered complete data"delegate:self cancelButtonTitle
"Ok" otherButtonTitles:nil];
[alert show];
[alert release];
}
sqlite3_close(db);
}
}
This is my code it is not updating my row plz help me??
thanks in advance..plz provide correction in the same code..
{
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
NSString *str_username=[defaults stringForKey
{
const char* updateSql;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent
//NSUInteger fromRow = [fromIndexPath row]+1;
//NSUInteger toRow = [toIndexPath row]+1;
//1000 is used as temporary SoundbrdID
if(sqlite3_open([writableDBPath UTF8String],&db)==SQLITE_OK)
{
updateSql=[[NSString stringWithFormat
retVal=sqlite3_exec(db,updateSql,NULL,NULL,&str1);
}
else
{
UIAlertView *alert =[[UIAlertView alloc] initWithTitle
[alert show];
[alert release];
}
sqlite3_close(db);
}
}
This is my code it is not updating my row plz help me??
thanks in advance..plz provide correction in the same code..