Click here to Skip to main content
15,910,773 members

Comments by GVS13 (Top 11 by date)

GVS13 3-Aug-17 5:06am View    
Am I missing something in that? Can you please help me to get that point?
GVS13 3-Aug-17 3:59am View    
for(int i = 0;scriptPath[i] != '\0';i++)
{
::SendMessage(g_hwndConsole,WM_CHAR,scriptPath[i],1L);
Sleep(3*1000);
}

Here g_hwndConsole is the powershell console handle
GVS13 29-Feb-16 7:08am View    
That will create a database named myDatabase if it not created or open it if it is already there.
GVS13 29-Feb-16 6:36am View    
Just try with the code I posted. And see the result.
GVS13 29-Feb-16 6:21am View    
I didn't get what exactly you are doing in your code. Anyways do this;
//Create database and table if not exist
SQLiteDatabase sqldb = openOrCreateDatabase("myDatabase", MODE_PRIVATE, null);
sqldb.execSQL("Create table if not exists DB_Table1 (sms_id INTEGER primary key autoincrement, sms_address TEXT not null, sms_body TEXT not null, status_msg INTEGER default 0);");
sqldb.close();

//To update table specific value

ContentValues cv = new ContentValues();
cv.put("status_msg", 1);
sqldb.update(DB_Table1, cv, "sms_id="+_id, null);
sqldb.close();

//To get updated data
SQLiteDatabase sqldb = openOrCreateDatabase("myDatabase", MODE_PRIVATE, null);
Cursor res = sqldb.rawQuery("select * from DB_Table1 where sms_id=" + _id + "", null);
res.moveToFirst();
int iStatus_Msg = res.getInt(res.getColumnIndex("status_msg"));
res.close();
sqldb.close()