15,910,773 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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()
GVS13
29-Feb-16 5:46am
View
Hold on. First make some changes, as your Status_Msg is an integer field keep values.put(Status_Msg, 1). And what are you trying to get by printing System.out.println("" + Status_Msg)? I guess Status_Msg is just a String column name that you have in your table. Isn't it?
GVS13
29-Feb-16 5:26am
View
Try keeping default as 0.
GVS13
29-Feb-16 5:23am
View
You have kept Status_Msg default 1. That is the reason you are getting the value for all Status_Msg as 1. Keep it default 0.
GVS13
29-Feb-16 5:19am
View
It looks okay. Can you show me the table schema. I mean your table structure, how you create a table.
GVS13
29-Feb-16 4:18am
View
Can you post the updated SetStatus function and the code snippet you are using to update the value.
GVS13
29-Feb-16 3:59am
View
Do you have primary key for each row as I mentioned? If you use primary key for the respective row to update, it will work only for that row field.
Show More