0
How could I write queries ?!
Some questions I founded how to write the queries too easily BUT the other questions I canât understand what the questions mean đ .
1 RĂ©ponse
+ 11
In android
If you write queries in your database than follow this steps
//getWritableDatabase() method provied you power to write data in your data base and this method return SQLiteDatabase Object.
SQLiteDatabase i=helper.getWritableDatabase();
// if you use ContentValues class this class provied functionality to write data in specific row and coloum .
ContentValues obj=new ContentValues();
obj.put(helper.NAME, name);
obj.put(helper.ADDRESS, password);
// her insert() method of class SQLiteDatabase helps to write data in specific table in this example my table name is TABLE_NAME
in insert(Table name,String nullcoloumhack ,ContentValueObject) method you have to enter three value first is
Table name second put null
And third value put object of ContentValue and this method return long value.
long id=i.insert(helper.TABLE_NAME, null, obj);