Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
HttpClient hc=new DefaultHttpClient();			
			Cursor c=db.rawQuery("select * from ADM ",null);
			while(c.moveToNext())
			{
				hp=new HttpPost("http://10.0.2.2:25582/CallBookWeb/Default2.aspx?xxx="+c.getString(0)+"&yyy="+c.getString(1));
				HttpResponse response = hc.execute(hp);
				HttpEntity entity = response.getEntity();
				BufferedReader in = new BufferedReader(new InputStreamReader(entity.getContent()), 65728);
			      String msg = in.readLine();
				if(msg.contains("success"))
				{
					
					updat(c.getString(0));
					Toast.makeText(getBaseContext(), "fff"+entity, Toast.LENGTH_LONG).show();
				}
			}


Java
public void updat(String c)
{
    Cursor c1=db.rawQuery("update ADM set status='y' where id="+c,null);
}



Hi guy's, I am new in Android Development and I wants to execute above code. My problem is udpade statement is not working. Where I did mistake to execute update statement? Please Help me.
Thanks in advance
Regards,
Siddharth Joshi
Posted
Updated 18-Jan-15 23:24pm
v3
Comments
Praveen Kumar Upadhyay 19-Jan-15 4:38am    
Is your if(msg.contains("success")) code block getting executed?
Sid_Joshi 19-Jan-15 4:39am    
Yes
Praveen Kumar Upadhyay 19-Jan-15 4:41am    
Okay. What is the value of c.getString(0)
Sid_Joshi 19-Jan-15 4:42am    
12
3
4
code transmits Sqlite data to sql server via asp.net app
Praveen Kumar Upadhyay 19-Jan-15 4:46am    
Try executing the query
update ADM set status='y' where id=1
on sqlite and if it works then check what error you are getting while updating.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900