-(BOOL) deletedata:(NSString*)name { const char *dbpath = [databasePath UTF8String]; if (sqlite3_open(dbpath, &database) == SQLITE_OK) { sqlite3_stmt *deletestmt; NSString *sql_str = [NSString stringWithFormat:@"delete from studentsDetail1 where name=\"%@\"",name]; const char *sql = [sql_str UTF8String]; int retVal; if ((retVal = sqlite3_prepare_v2(database, sql, -1, &deletestmt, NULL)) == SQLITE_OK) { int result; if ((result =sqlite3_step(deletestmt)) != SQLITE_DONE) { NSLog(@"Failed to execute the query %d",result); } else { NSLog(@"Succesfully Deleted Row"); } sqlite3_finalize(deletestmt); } else { NSLog(@ "Error in preparing Delete statement %d",retVal); } int result1 = sqlite3_close(database); if (result1 != SQLITE_OK){ NSLog(@"Failure in closing connection to database. Result %d",result1); } else { NSLog(@"Successfully closed DB connection") ; } } return YES; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)