Created
June 7, 2016 07:09
-
-
Save manishpatelgt/889e4ee45809e92fb5684021186a1258 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This method will return if your table exist a field or not | |
public boolean isFieldExist(SQLiteDatabase db,String tableName, String fieldName) | |
{ | |
Cursor res= db.rawQuery("SELECT * FROM " + tableName + " LIMIT 0", null); | |
if (res.getColumnIndex(fieldName) != -1) | |
return true; | |
else | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment