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.

  1. 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.

  2. # Import in your source file

  3. 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); 

  4. Close the database connection sqlite3_close (database);

For more information about the C interface, see.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -