SQLite DB in iPhone -
Can you please tell me how to make SQLite DB in the iPhone and the purpose of CRUD operation is to program the database on the database Do the work. How to program this ??
I know how to make DB and table through the command line, but how to program it ??
Help me ..
Thank you.
-
Add libsqlite3.dyllib library to your project. Click on the Framework Group, select Add-> Existing Frameworks ... and scroll down to select and add libsqlite3.dyllib.
-
# Import in your source file
-
Open or create a database file with the path in NSString
file
error = sqlite3_open ([file cStringUsingEncoding: NSUTF8StringEncoding], & database) ; If (error! = SQLITE_OK) {NSLog (@ "error result sqlite3_open ():% d", error); Sqlite3_close (database); } Execute orders :
four * errors, age = zero; Int error = sqlite3_exec (database, [aQuery cStringUsingEncoding: NSUTF8StringEncoding], zero, zero, and error messages); If (error! = SQLITE_OK) NSLog (@ "error result sqlite3_exec ():% d:% s", error, error message); If (error message! = Zero) sqlite3_free (error message);
-
Close the database connection sqlite3_close (database);
For more information about the C interface, see.
Comments
Post a Comment