۱۳۹۴/۰۲/۰۵, ۰۵:۱۱ ب.ظ
۱۳۹۴/۰۲/۰۵, ۰۷:۲۷ ب.ظ
سلام
کد زیر را امتحان کنید:
کد زیر را امتحان کنید:
کد پیاچپی:
SQLiteDatabase myDataBase = SQLiteDatabase.openDatabase(Environment.getExternalStorageDirectory()+"/database.db", null, SQLiteDatabase.OPEN_READONLY);
String selectQuery = "SELECT * FROM 'table-name' WHERE Column ='"+Variable+"'";
Cursor c =myDataBase.rawQuery(selectQuery, null);
String myValue1 = null;
if (c.getCount() >0) {
c.moveToFirst();
myValue1 =c.getString(1);
}
else if (c.getCount() <= 0){
myValue1 = "Not Found";
}
c.close();
myDataBase.close();