On Sep 14, 1:07 pm, Bishan <[email protected]> wrote:
>                 SQLiteDatabase db = openOrCreateDatabase("TestDB", 
> MODE_PRIVATE, null);
>                 db.execSQL("CREATE TABLE IF NOT EXISTS Client (clientID INT," 
> +
>                                 " clientName VARCHAR, " +
>                                 "routeName VARCHAR, " +
>                                 "visitingFrequency INT, " +
>                                 "creditLimit INT, " +
>                                 "outletType VARCHAR, " +
>                                 "shopGrade VARCHAR, " +
>                                 "creditPeriodDays INT(2), " +
>                                 "streetNumber VARCHAR, " +
>                                 "streetName VARCHAR, " +
>                                 "city VARCHAR, " +
>                                 "district VARCHAR, " +
>                                 "csrId INT, " +
>                                 "comments VARCHAR, " +
>                                 "active VARCHAR(1))");
>
>                 db.execSQL("INSERT INTO Client VALUES (110001, " +
>                                 "'LASANTHA STORES', " +
>                                 "'R1', " +
>                                 "4, " +
>                                 "0, " +
>                                 "'GROCERY', " +
>                                 "'BRONZE', " +
>                                 "4, " +
>                                 "'2', " +
>                                 "'HIGHL LEVEL ROAD', " +
>                                 "'MAHARAGAMA', " +
>                                 "'COLOMBO', " +
>                                 "1091, " +
>                                 "'Test Client', " +
>                                 "'Y')");
>                 db.close();
>
> tried above one and it's worked. now i need to insert data in XML to
> my database. i know how to read XML file and get values in xml
> elements. but have no idea about how to insert them into database.
>

Have you read docs of SQLiteDatabase? There is a method for row
inserting.

Also why dont you use SQLiteDatabaseHelper which is recommended way of
creating/ugrading/accessing of database?

pskink

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to